//export gsfSeek
425511
func gsfSeek(i int64, w Whence, user_data unsafe.Pointer) int64 {
	if user_data == nil {
		panic("nil ud")
	}
	l := (*virtualIo)(user_data)
	return l.v.Seek(i, w, l.v.UserData)
}
250446
func (c *Conn) exchangeKeys() (serverKeyExchange *serverKeyExchangeMsg, err error) {
	msg, err := c.readHandshake()
	if err != nil {
		return
	}
	serverKeyExchange, ok := msg.(*serverKeyExchangeMsg)
	if !ok {
		return nil, unexpectedMessageError(serverKeyExchange, msg)
	}
	return
}
1268939
func (soc *Socket) GetGssapiServer() (bool, error) {
	if minor < 1 {
		return false, ErrorNotImplemented41
	}
	v, err := soc.getInt(C.ZMQ_GSSAPI_SERVER)
	return v != 0, err
}
950244
func (ir *IdentifyOutcome) Export(g *GlobalContext) *keybase1.IdentifyOutcome {
	v := make([]string, len(ir.Warnings))
	for i, w := range ir.Warnings {
		v[i] = w.Warning()
	}
	del := make([]keybase1.TrackDiff, len(ir.Revoked))
	for i, d := range ir.Revoked {
		del[i] = *ExportTrackDiff(d)
	}
	ret := &keybase1.IdentifyOutcome{
		Username:          ir.Username.String(),
		Status:            ExportErrorAsStatus(g, ir.Error),
		Warnings:          v,
		TrackUsed:         ExportTrackSummary(ir.TrackUsed, ir.Username.String()),
		TrackStatus:       ir.TrackStatus(),
		NumTrackFailures:  ir.NumTrackFailures(),
		NumTrackChanges:   ir.NumTrackChanges(),
		NumProofFailures:  ir.NumProofFailures(),
		NumRevoked:        ir.NumRevoked(),
		NumProofSuccesses: ir.NumProofSuccesses(),
		Revoked:           del,
		TrackOptions:      ir.TrackOptions,
		Reason:            ir.Reason,
	}
	return ret
}
798398
func extractSchemaOptionFromMessageDescriptor(msg *pbdescriptor.DescriptorProto) (*swagger_options.Schema, error) {
	if msg.Options == nil {
		return nil, nil
	}
	if !proto.HasExtension(msg.Options, swagger_options.E_Openapiv2Schema) {
		return nil, nil
	}
	ext, err := proto.GetExtension(msg.Options, swagger_options.E_Openapiv2Schema)
	if err != nil {
		return nil, err
	}
	opts, ok := ext.(*swagger_options.Schema)
	if !ok {
		return nil, fmt.Errorf("extension is %T; want a Schema", ext)
	}
	return opts, nil
}
416926
func ParseLegacyExporter(legacyExporter string, legacyExporterOpts []string) ([]client.ExportEntry, error) {
	var ex client.ExportEntry
	ex.Type = legacyExporter
	var err error
	ex.Attrs, err = attrMap(legacyExporterOpts)
	if err != nil {
		return nil, errors.Wrap(err, "invalid exporter-opt")
	}
	if v, ok := ex.Attrs["dest"]; ok {
		return nil, errors.Errorf("dest=%s not supported for --exporter-opt, you meant output=%s?", v, v)
	}
	ex.Output, ex.OutputDir, err = resolveExporterDest(ex.Type, ex.Attrs["output"])
	if err != nil {
		return nil, errors.Wrap(err, "invalid exporter option: output")
	}
	if ex.Output != nil || ex.OutputDir != "" {
		delete(ex.Attrs, "output")
	}
	return []client.ExportEntry{ex}, nil
}
18296
func (p *iscsiProvisioner) exportCreate(vol string, lun int32, pool string, initiator string) error {
	client, err := p.getConnection()
	defer client.Close()
	if err != nil {
		log.Warnln(err)
		return err
	}
	args := exportCreateArgs{
		Pool:         pool,
		Vol:          vol,
		InitiatorWwn: initiator,
		Lun:          lun,
	}
	err = client.Call("export_create", args, nil)
	return err
}
163577
func (k *Key) ExportPrivate() ([]byte, error) {
	var privPEMBlock *pem.Block
	switch priv := k.Private.(type) {
	case *rsa.PrivateKey:
		privBytes := x509.MarshalPKCS1PrivateKey(priv)
		privPEMBlock = &pem.Block{
			Type:  rsaPrivateKeyPEMBlockType,
			Bytes: privBytes,
		}
	default:
		return nil, errors.New("only RSA private key is supported")
	}

	buf := new(bytes.Buffer)
	if err := pem.Encode(buf, privPEMBlock); err != nil {
		return nil, err
	}
	return buf.Bytes(), nil
}
816412
func (k *Key) ExportEncryptedPrivate(password []byte) ([]byte, error) {
	var privBytes []byte
	switch priv := k.Private.(type) {
	case *rsa.PrivateKey:
		privBytes = x509.MarshalPKCS1PrivateKey(priv)
	default:
		return nil, errors.New("only RSA private key is supported")
	}

	privPEMBlock, err := x509.EncryptPEMBlock(rand.Reader, rsaPrivateKeyPEMBlockType, privBytes, password, x509.PEMCipher3DES)
	if err != nil {
		return nil, err
	}

	buf := new(bytes.Buffer)
	if err := pem.Encode(buf, privPEMBlock); err != nil {
		return nil, err
	}
	return buf.Bytes(), nil
}
718074
func (a *managedAddress) ExportPrivKey() (*btcutil.WIF, error) {
	pk, err := a.PrivKey()
	if err != nil {
		return nil, err
	}

	return btcutil.NewWIF(pk, a.manager.rootManager.chainParams, a.compressed)
}
693094
func (s *GlobalStore) Export(w io.Writer) (n int, err error) {
	tw := tar.NewWriter(w)
	defer tw.Close()

	buf := bytes.NewBuffer(make([]byte, 0, 1024))
	encoder := json.NewEncoder(buf)

	snap, err := s.db.GetSnapshot()
	if err != nil {
		return 0, err
	}

	iter := snap.NewIterator(util.BytesPrefix([]byte{indexForHashesByNodePrefix}), nil)
	defer iter.Release()

	var currentKey string
	var addrs []common.Address

	saveChunk := func() error {
		hexKey := currentKey

		data, err := snap.Get(indexDataKey(common.Hex2Bytes(hexKey)), nil)
		if err != nil {
			return fmt.Errorf("get data %s: %v", hexKey, err)
		}

		buf.Reset()
		if err = encoder.Encode(mock.ExportedChunk{
			Addrs: addrs,
			Data:  data,
		}); err != nil {
			return err
		}

		d := buf.Bytes()
		hdr := &tar.Header{
			Name: hexKey,
			Mode: 0644,
			Size: int64(len(d)),
		}
		if err := tw.WriteHeader(hdr); err != nil {
			return err
		}
		if _, err := tw.Write(d); err != nil {
			return err
		}
		n++
		return nil
	}

	for iter.Next() {
		k := bytes.TrimPrefix(iter.Key(), []byte{indexForHashesByNodePrefix})
		i := bytes.Index(k, []byte{keyTermByte})
		if i < 0 {
			continue
		}
		hexKey := string(k[:i])

		if currentKey == "" {
			currentKey = hexKey
		}

		if hexKey != currentKey {
			if err = saveChunk(); err != nil {
				return n, err
			}

			addrs = addrs[:0]
		}

		currentKey = hexKey
		addrs = append(addrs, common.BytesToAddress(k[i+1:]))
	}

	if len(addrs) > 0 {
		if err = saveChunk(); err != nil {
			return n, err
		}
	}

	return n, iter.Error()
}
1290451
func (r *Repo) Export(ctx context.Context, ref string) (*Export, error) {
	dir, err := r.workingClone(ctx, "")
	if err != nil {
		return nil, err
	}
	if err = checkout(ctx, dir, ref); err != nil {
		return nil, err
	}
	return &Export{dir}, nil
}
52900
func exportCertRef(certRef C.SecCertificateRef) (*x509.Certificate, error) {
	derRef := C.SecCertificateCopyData(certRef)
	if derRef == nilCFDataRef {
		return nil, errors.New("error getting certificate from identity")
	}
	defer C.CFRelease(C.CFTypeRef(derRef))

	der := cfDataToBytes(derRef)
	crt, err := x509.ParseCertificate(der)
	if err != nil {
		return nil, err
	}

	return crt, nil
}
1068703
func (soc *Socket) GetGssapiPlaintext() (bool, error) {
	if minor < 1 {
		return false, ErrorNotImplemented41
	}
	v, err := soc.getInt(C.ZMQ_GSSAPI_PLAINTEXT)
	return v != 0, err
}
315047
func (p *iscsiProvisioner) exportList() (exportList, error) {
	client, err := p.getConnection()
	defer client.Close()
	if err != nil {
		log.Warnln(err)
		return nil, err
	}
	var result1 exportList
	err = client.Call("export_list", nil, &result1)
	return result1, err
}
1149475
func (c *Client) GetExports(ctx context.Context) (ExportList, error) {
	return api.ExportsList(ctx, c.API)
}
1034778
func (i item) export(f gregor.ObjFactory) (gregor.Item, error) {
	md := i.item.Metadata()
	return f.MakeItem(md.UID(), md.MsgID(), md.DeviceID(), i.ctime, i.item.Category(), i.dtime, i.item.Body())
}