// getXAttr fetches the extended attribute for a particular key on
// file
492552
func getXAttr(path, key string) (string, error) {
	data, e := xattr.Get(path, key)
	if e != nil {
		return "", e
	}
	return string(data), nil
}
1350511
func Listxattr(path string) ([]string, error) {
	// find size.
	size, err := listxattr(path, nil, 0, 0)
	if err != nil {
		return nil, &XAttrError{"listxattr", path, "", err}
	}
	buf := make([]byte, size)
	// Read into buffer of that size.
	read, err := listxattr(path, &buf[0], size, 0)
	if err != nil {
		return nil, &XAttrError{"listxattr", path, "", err}
	}
	return nullTermToStrings(buf[:read]), nil
}
236983
func (c *Client) GetTxOut(txHash *chainhash.Hash, index uint32, mempool bool) (*btcjson.GetTxOutResult, error) {
	return c.GetTxOutAsync(txHash, index, mempool).Receive()
}
585144
func LGetxattr(path, attr string) ([]byte, error) {
	return getxattrAll(path, attr, unix.Lgetxattr)
}
591532
func Setxattr(path, name string, data []byte) error {
	if err := setxattr(path, name, &data[0], len(data), 0, 0); err != nil {
		return &XAttrError{"setxattr", path, name, err}
	}
	return nil
}
546921
func Getattr(fd int, state *Termios) (err error) {
	_, _, e1 := unix.Syscall(unix.SYS_IOCTL, uintptr(fd),
		uintptr(TCGETS), uintptr(unsafe.Pointer(state)))
	if e1 != 0 {
		err = e1
	}
	return
}
803660
func (c *context) resolveXAttrs(fp string, fi os.FileInfo, base *resource) (map[string][]byte, error) {
	if fi.Mode().IsRegular() || fi.Mode().IsDir() {
		xattrDriver, ok := c.driver.(driverpkg.XAttrDriver)
		if !ok {
			log.Println("xattr extraction not supported")
			return nil, ErrNotSupported
		}

		return xattrDriver.Getxattr(fp)
	}

	if fi.Mode()&os.ModeSymlink != 0 {
		lxattrDriver, ok := c.driver.(driverpkg.LXAttrDriver)
		if !ok {
			log.Println("xattr extraction for symlinks not supported")
			return nil, ErrNotSupported
		}

		return lxattrDriver.LGetxattr(fp)
	}

	return nil, nil
}
1260853
func (h NoXattrHandler) Getxattr(context.Context,
	*fuse.GetxattrRequest, *fuse.GetxattrResponse) error {
	return fuse.ENOTSUP
}
424566
func (handler *Handler) getTxCtxId(chainID string, txid string) string {
	return chainID + txid
}
665357
func LSetxattr(path string, attr string, data []byte, flags int) (err error) {
	return unsupported
}
1274608
func (b *BoolWrapper) UnmarshalXMLAttr(attr xml.Attr) error {
	*b = false
	if strings.ToLower(attr.Value) == "true" {
		*b = true
	}

	return nil
}
1424
func (z *Tokenizer) TagAttr() (key, val []byte, moreAttr bool) {
	if z.nAttrReturned < len(z.attr) {
		switch z.tt {
		case StartTagToken, SelfClosingTagToken:
			x := z.attr[z.nAttrReturned]
			z.nAttrReturned++
			key = z.buf[x[0].start:x[0].end]
			val = z.buf[x[1].start:x[1].end]
			return lower(key), unescape(convertNewlines(val), true), z.nAttrReturned < len(z.attr)
		}
	}
	return nil, nil, false
}
27044
func Setxattr(path string, attr string, data []byte, flags int) (err error) {
	return setxattr(path, attr, data, 0, flags)
}
283441
func (h NoXattrHandler) Setxattr(context.Context, *fuse.SetxattrRequest) error {
	return fuse.ENOTSUP
}
1052380
func getAttr(fr *Frame, x Value, name string) (Value, error) {
	// field or method?
	if x, ok := x.(HasAttrs); ok {
		if v, err := x.Attr(name); v != nil || err != nil {
			return v, err
		}
	}

	return nil, fmt.Errorf("%s has no .%s field or method", x.Type(), name)
}
315953
func LRemovexattr(path string, attr string) (err error) {
	return unix.Lremovexattr(path, attr)
}
84137
func getCtxKey(method string, url string) string {
	keyTerms := []string{strings.ToUpper(method), url}
	return strings.Join(keyTerms, "_")
}