// iface2vstr converts an interface to an array of strings
548743
func iface2vstr(a interface{}) []string {
	r := []string{}
	switch a.(type) {
	case []interface{}:
		for _, item := range a.([]interface{}) {
			switch item.(type) {
			case string:
				r = append(r, item.(string))
			}
		}
	}
	return r
}
321338
func isRelativeJSONPointer(v interface{}) bool {
	s, ok := v.(string)
	if !ok {
		return false
	}
	if s == "" {
		return false
	}
	if s[0] == '0' {
		s = s[1:]
	} else if s[0] >= '0' && s[0] <= '9' {
		for s != "" && s[0] >= '0' && s[0] <= '9' {
			s = s[1:]
		}
	} else {
		return false
	}
	return s == "#" || isJSONPointer(s)
}
86634
func (service *VboxPortType) IFilegetFileName(request *IFilegetFileName) (*IFilegetFileNameResponse, error) {
	response := new(IFilegetFileNameResponse)
	err := service.client.Call("", request, response)
	if err != nil {
		return nil, err
	}

	return response, nil
}
243585
func IsSpace(c byte) bool {
	for _, r := range []byte("\t\n\r\f\v") {
		if c == r {
			return true
		}
	}
	return false
}
302
func Str2JSType(s string) JSType {
	var (
		output JSType
	)
	s = strings.TrimSpace(s) // santize the given string
	switch {
	case isBool(s):
		output = Bool
	case isFloat(s):
		output = Float
	case isInt(s):
		output = Int
	case isNull(s):
		output = Null
	default:
		output = String // if all alternatives have been eliminated, the input is a string
	}
	return output
}
1138692
func validateInterface(iface *net.Interface) error {
	if !ifaceNameRegexp.MatchString(iface.Name) {
		return fmt.Errorf("Invalid interface name %q", iface.Name)
	}
	return nil
}
209111
func ifaceAddIPv4Addr(iface *net.Interface, ip net.IP, mask net.IPMask) error {
	if ip.To4() == nil {
		return fmt.Errorf("IP %v is not a valid IPv4 address", ip)
	}
	brd := make(net.IP, net.IPv4len)
	copy(brd, ip.To4())
	for i := 0; i < net.IPv4len; i++ {
		brd[i] |= ^mask[i]
	}
	prefixLen, _ := mask.Size()
	return ipRunIface(iface, "addr add %s/%d brd %s dev %s", ip, prefixLen, brd, iface.Name)
}
122488
func TcGetAttr(fd uintptr) (*Termios, error) {
	var termios = &Termios{}
	if _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, getTermios, uintptr(unsafe.Pointer(termios))); err != 0 {
		return nil, err
	}
	return termios, nil
}
1041117
func InitI2C() error {
	if i2cDriverInitialized {
		return nil
	}

	desc, err := DescribeHost()
	if err != nil {
		return err
	}

	if desc.I2CDriver == nil {
		return ErrFeatureNotSupported
	}

	i2cDriverInstance = desc.I2CDriver()
	i2cDriverInitialized = true

	return nil
}
409432
func MakePreimageFromStr(newPreimage string) (Preimage, error) {
	// Return error if preimage string is of incorrect length.
	if len(newPreimage) != PreimageSize*2 {
		return Preimage{}, fmt.Errorf("invalid preimage string length "+
			"of %v, want %v", len(newPreimage), PreimageSize*2)
	}

	preimage, err := hex.DecodeString(newPreimage)
	if err != nil {
		return Preimage{}, err
	}

	return MakePreimage(preimage)
}
93138
func (options *Options) ValueStr(name string) string {
	return Str(options.Value(name))
}
1343310
func DecodeObjectToStr(in []byte) string {
	if binaryFmt(in) {
		var b bytes.Buffer
		cbor2JsonOneObject(getReader(string(in)), &b)
		return b.String()
	}
	return string(in)
}
165375
func ifaceAddIPAddr(iface *net.Interface, ip net.IP, mask net.IPMask) error {
	if ip.To4() != nil {
		return ifaceAddIPv4Addr(iface, ip, mask)
	}
	return ifaceAddIPv6Addr(iface, ip, mask)
}
56180
func (m *HeaderCtxFlag) FlagStr() string {
	m.mu.RLock()
	ret := m.expectedVal
	m.mu.RUnlock()
	return ret
}
883837
func IfAttrs(selectorName string, ifAddrs IfAddrs) (string, error) {
	if len(ifAddrs) == 0 {
		return "", nil
	}

	attrName := AttrName(strings.ToLower(selectorName))
	attrVal, err := ifAddrs[0].Attr(attrName)
	return attrVal, err
}
1002770
func Tcgetattr(fd uintptr, argp *syscall.Termios) error {
	return ioctl(fd, syscall.TIOCGETA, uintptr(unsafe.Pointer(argp)))
}
189140
func (service *VboxPortType) IFilereadAt(request *IFilereadAt) (*IFilereadAtResponse, error) {
	response := new(IFilereadAtResponse)
	err := service.client.Call("", request, response)
	if err != nil {
		return nil, err
	}

	return response, nil
}