// CreateRGBSurfaceFrom allocate a new RGB surface with existing pixel data.
// (https://wiki.libsdl.org/SDL_CreateRGBSurfaceFrom)
495619
func CreateRGBSurfaceFrom(pixels unsafe.Pointer, width, height int32, depth, pitch int, Rmask, Gmask, Bmask, Amask uint32) (*Surface, error) {
	surface := (*Surface)(unsafe.Pointer(C.SDL_CreateRGBSurfaceFrom(
		pixels,
		C.int(width),
		C.int(height),
		C.int(depth),
		C.int(pitch),
		C.Uint32(Rmask),
		C.Uint32(Gmask),
		C.Uint32(Bmask),
		C.Uint32(Amask))))
	if surface == nil {
		return nil, GetError()
	}
	return surface, nil
}
425517
func CreateNewGSLB(gslbName string) *GSLB {
	return &GSLB{
		Resource: &Resource{},
		propName: propName{Name: gslbName},
		Provider: GSLBProvider{
			Class: "gslb",
		},
		Settings: GSLBSettings{
			GSLB: GSLBRecordSets{
				DelayLoop:   10,
				HealthCheck: defaultGSLBHealthCheck,
				Weighted:    "True",
				Servers:     []GSLBServer{},
			},
		},
	}

}
833470
func (row *NuageVMTableRow) CreateOVSDBRow(ovsdbRow map[string]interface{}) error {

	metadataMap, err := libovsdb.NewOvsMap(row.Metadata)
	if err != nil {
		return err
	}

	portSet, err := libovsdb.NewOvsSet(row.Ports)
	if err != nil {
		return err
	}

	ovsdbRow["type"] = row.Type
	ovsdbRow["event"] = row.Event
	ovsdbRow["event_type"] = row.EventType
	ovsdbRow["state"] = row.State
	ovsdbRow["reason"] = row.Reason
	ovsdbRow["vm_uuid"] = row.VMUuid
	ovsdbRow["domain"] = row.Domain
	ovsdbRow["vm_name"] = row.VMName
	ovsdbRow["nuage_user"] = row.NuageUser
	ovsdbRow["nuage_enterprise"] = row.NuageEnterprise
	ovsdbRow["metadata"] = metadataMap
	ovsdbRow["ports"] = portSet
	ovsdbRow["dirty"] = row.Dirty

	return nil
}
218798
func LoadXCFRW(src *sdl.RWops) (*sdl.Surface, error) {
	_src := (*C.SDL_RWops)(unsafe.Pointer(src))
	_surface := C.IMG_LoadXCF_RW(_src)
	if _surface == nil {
		return nil, GetError()
	}
	return (*sdl.Surface)(unsafe.Pointer(_surface)), nil
}
790174
func (o *VPort) CreateBGPNeighbor(child *BGPNeighbor) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
924692
func NewContextForRGBA(im *image.RGBA) *Context {
	w := im.Bounds().Size().X
	h := im.Bounds().Size().Y
	return &Context{
		width:         w,
		height:        h,
		rasterizer:    raster.NewRasterizer(w, h),
		im:            im,
		color:         color.Transparent,
		fillPattern:   defaultFillStyle,
		strokePattern: defaultStrokeStyle,
		lineWidth:     1,
		fillRule:      FillRuleWinding,
		fontFace:      basicfont.Face7x13,
		fontHeight:    13,
		matrix:        Identity(),
	}
}
729010
func SVGSurfaceCreate(filename string, widthInPoints, heightInPoints float64) *SVGSurface {
	c_filename := C.CString(filename)
	defer C.free(unsafe.Pointer(c_filename))
	ret := &SVGSurface{wrapSurface(C.cairo_svg_surface_create(c_filename, C.double(widthInPoints), C.double(heightInPoints)))}
	if err := ret.status(); err != nil {
		panic(err)
	}
	return ret
}
846591
func (api UsersAPI) CreateAvatarFromLink(w http.ResponseWriter, r *http.Request) {
	username := mux.Vars(r)["username"]

	avatar := user.Avatar{}

	if err := json.NewDecoder(r.Body).Decode(&avatar); err != nil {
		http.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
		return
	}

	userMgr := user.NewManager(r)
	u, err := userMgr.GetByName(username)
	if handleServerError(w, "getting user by name", err) {
		return
	}

	if !validateNewAvatar(w, avatar.Label, u) {
		return
	}

	userMgr.SaveAvatar(username, avatar)

	w.WriteHeader(http.StatusCreated)
	json.NewEncoder(w).Encode(&avatar)
}
462503
func (_class SRClass) CreateNewBlob(sessionID SessionRef, sr SRRef, name string, mimeType string, public bool) (_retval BlobRef, _err error) {
	_method := "SR.create_new_blob"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_srArg, _err := convertSRRefToXen(fmt.Sprintf("%s(%s)", _method, "sr"), sr)
	if _err != nil {
		return
	}
	_nameArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "name"), name)
	if _err != nil {
		return
	}
	_mimeTypeArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "mime_type"), mimeType)
	if _err != nil {
		return
	}
	_publicArg, _err := convertBoolToXen(fmt.Sprintf("%s(%s)", _method, "public"), public)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _srArg, _nameArg, _mimeTypeArg, _publicArg)
	if _err != nil {
		return
	}
	_retval, _err = convertBlobRefToGo(_method + " -> ", _result.Value)
	return
}
402730
func (o *VM) CreateVMInterface(child *VMInterface) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
222015
func CreateSoftwareRenderer(surface *Surface) (*Renderer, error) {
	renderer := C.SDL_CreateSoftwareRenderer(surface.cptr())
	if renderer == nil {
		return nil, GetError()
	}
	return (*Renderer)(unsafe.Pointer(renderer)), nil
}
1321316
func (a *ArgoCDRepoServer) CreateGRPC() *grpc.Server {
	server := grpc.NewServer(a.opts...)
	version.RegisterVersionServiceServer(server, &version.Server{})
	manifestService := repository.NewService(a.gitFactory, a.cache, a.parallelismLimit)
	repository.RegisterRepoServerServiceServer(server, manifestService)

	// Register reflection service on gRPC server.
	reflection.Register(server)

	return server
}
1229875
func (t *tOps) createFrom(src iterator.Iterator) (f *tFile, n int, err error) {
	w, err := t.create()
	if err != nil {
		return
	}

	defer func() {
		if err != nil {
			w.drop()
		}
	}()

	for src.Next() {
		err = w.append(src.Key(), src.Value())
		if err != nil {
			return
		}
	}
	err = src.Error()
	if err != nil {
		return
	}

	n = w.tw.EntriesLen()
	f, err = w.finish()
	return
}
197489
func (_class HostClass) CreateNewBlob(sessionID SessionRef, host HostRef, name string, mimeType string, public bool) (_retval BlobRef, _err error) {
	_method := "host.create_new_blob"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_hostArg, _err := convertHostRefToXen(fmt.Sprintf("%s(%s)", _method, "host"), host)
	if _err != nil {
		return
	}
	_nameArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "name"), name)
	if _err != nil {
		return
	}
	_mimeTypeArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "mime_type"), mimeType)
	if _err != nil {
		return
	}
	_publicArg, _err := convertBoolToXen(fmt.Sprintf("%s(%s)", _method, "public"), public)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _hostArg, _nameArg, _mimeTypeArg, _publicArg)
	if _err != nil {
		return
	}
	_retval, _err = convertBlobRefToGo(_method + " -> ", _result.Value)
	return
}
562607
func (self *StateDB) createObject(addr common.Address) (newobj, prev *stateObject) {
	prev = self.getStateObject(addr)
	newobj = newObject(self, addr, Account{})
	newobj.setNonce(0) // sets the object to dirty
	if prev == nil {
		self.journal.append(createObjectChange{account: &addr})
	} else {
		self.journal.append(resetObjectChange{prev: prev})
	}
	self.setStateObject(newobj)
	return newobj, prev
}
1317611
func (window *Window) GetSurface() (*Surface, error) {
	surface := (*Surface)(unsafe.Pointer(C.SDL_GetWindowSurface(window.cptr())))
	if surface == nil {
		return nil, GetError()
	}
	return surface, nil
}
864476
func XlibSurfaceCreate(dpy unsafe.Pointer, drawable uint64, visual unsafe.Pointer, width, height int) *XlibSurface {
	ret := &XlibSurface{wrapSurface(C.cairo_xlib_surface_create((*C.Display)(dpy), C.Drawable(drawable), (*C.Visual)(visual), C.int(width), C.int(height)))}
	if err := ret.status(); err != nil {
		panic(err)
	}
	return ret
}