// Wrap wraps an existing Configuration structure and ties it to a file on
// disk.
2653
func Wrap(path string, cfg Configuration) Wrapper {
	w := &wrapper{
		cfg:  cfg,
		path: path,
		mut:  sync.NewMutex(),
	}
	return w
}
1016884
func Wrap(err error, msg string) error {
	renamed := errors.New(msg + ": " + err.Error())
	return NewRenamedError(err, renamed)
}
287031
func (ctx *CtxId) Wrap(
	confReq bool, qopReq QOP, inputMessageBuffer *Buffer) (
	confState bool, outputMessageBuffer *Buffer, err error) {

	min := C.OM_uint32(0)

	encrypt := C.int(0)
	if confReq {
		encrypt = 1
	}

	outputMessageBuffer, err = ctx.MakeBuffer(allocGSSAPI)
	if err != nil {
		return false, nil, err
	}

	encrypted := C.int(0)

	maj := C.wrap_gss_wrap(ctx.Fp_gss_wrap,
		&min,
		ctx.C_gss_ctx_id_t,
		encrypt,
		C.gss_qop_t(qopReq),
		inputMessageBuffer.C_gss_buffer_t,
		&encrypted,
		outputMessageBuffer.C_gss_buffer_t)

	err = ctx.stashLastStatus(maj, min)
	if err != nil {
		return false, nil, err
	}

	return encrypted != 0,
		outputMessageBuffer,
		nil
}
644587
func WrapS(e error, skip int) error {
	if e == nil {
		return nil
	}
	return errors.Wrap(e, skip+1)
}
1189414
func (c *Color) wrap(s string) string {
	if c.isNoColorSet() {
		return s
	}

	return c.format() + s + c.unformat()
}
101858
func wrapExtensions(file *FileDescriptor) []*ExtensionDescriptor {
	var sl []*ExtensionDescriptor
	for _, field := range file.Extension {
		sl = append(sl, &ExtensionDescriptor{common{file}, field, nil})
	}
	return sl
}
220412
func (as ArraySpec) Wrap2(val Input) Input {
	return as.proc(func(i Input) Input {
		return i.Wrap2(val)
	})
}
1293368
func (m *Module) wrap(h Handle) httprouter.Handle {
	return func(rw http.ResponseWriter, req *http.Request, par Params) {
		err := h(rw, req, par)
		if err != nil && m.ErrorHandler != nil {
			m.ErrorHandler(rw, req, err)
		}
	}
}
469313
func (logger *RequestLogger) Wrap(innerconnection uaa.Connection) uaa.Connection {
	logger.connection = innerconnection
	return logger
}
962965
func WrapHandler(h *webdav.Handler, confs ...func(c *Config)) gin.HandlerFunc {
	defaultConfig := &Config{
		URL: "doc.json",
	}

	for _, c := range confs {
		c(defaultConfig)
	}

	return CustomWrapHandler(defaultConfig, h)
}
81803
func (b *Buffer) Wrap(next http.Handler) error {
	b.next = next
	return nil
}
189852
func Wrap(m *lib.Message) lib.Dnstap {
	t := lib.Dnstap_MESSAGE
	return lib.Dnstap{
		Type:    &t,
		Message: m,
	}
}
1342301
func (al *ApacheLog) Wrap(h http.Handler, dst io.Writer) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		ctx := logctx.Get(r)
		defer logctx.Release(ctx)

		wrapped := httputil.GetResponseWriter(w)
		defer httputil.ReleaseResponseWriter(wrapped)

		defer func() {
			ctx.Finalize(wrapped)
			if err := al.WriteLog(dst, ctx); err != nil {
				// Hmmm... no where to log except for stderr
				os.Stderr.Write([]byte(err.Error()))
				return
			}
		}()

		h.ServeHTTP(wrapped, r)
	})
}
191448
func (m *BucketRequestCounter) Wrap(next http.Handler) http.Handler {
	f := func(w http.ResponseWriter, r *http.Request) {
		m.ServeHTTP(w, r, next)
	}
	return http.HandlerFunc(f)
}
1040398
func Wrap(l net.Listener, m mode) *T {
	t := &T{
		l:    l,
		mode: m,
		// To keep the expected contention rate constant we'd have to
		// grow this as numcpu**2. In practice, CPU counts don't
		// generally grow without bound, and contention is probably
		// going to be small enough that nobody cares anyways.
		shards: make([]shard, 2*runtime.NumCPU()),
	}
	for i := range t.shards {
		t.shards[i].init(t)
	}
	return t
}
832576
func (db *DB) Wrap(sqlTx *sql.Tx) *Tx {
	return &Tx{db.newBuilder(sqlTx), sqlTx}
}
922754
func (retry *RetryRequest) Wrap(innerconnection uaa.Connection) uaa.Connection {
	retry.connection = innerconnection
	return retry
}