当前位置: 首页>>代码示例>>Golang>>正文


Golang C._Bool函数代码示例

本文整理汇总了Golang中C._Bool函数的典型用法代码示例。如果您正苦于以下问题:Golang _Bool函数的具体用法?Golang _Bool怎么用?Golang _Bool使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了_Bool函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: Add

func (v *VertexDecl) Add(attrib Attrib, num uint8, typ AttribType, normalized bool, asint bool) {
	C.bgfx_vertex_decl_add(
		&v.decl,
		C.bgfx_attrib_t(attrib),
		C.uint8_t(num),
		C.bgfx_attrib_type_t(typ),
		C._Bool(normalized),
		C._Bool(asint),
	)
}
开发者ID:gmacd,项目名称:go-bgfx,代码行数:10,代码来源:bridge.go

示例2: _goHandlePointerMotion

//export _goHandlePointerMotion
func _goHandlePointerMotion(view C.wlc_handle, time C.uint32_t, point *C.struct_wlc_point) C._Bool {
	return C._Bool(wlcInterface.Pointer.Motion(
		View(view),
		uint32(time),
		pointCtoGo(point),
	))
}
开发者ID:mikkeloscar,项目名称:go-wlc,代码行数:8,代码来源:interface.go

示例3: Attach

// Attach attaches a socket to zero or more endpoints. If endpoints is not null,
// parses as list of ZeroMQ endpoints, separated by commas, and prefixed by
// '@' (to bind the socket) or '>' (to attach the socket). If the endpoint
// does not start with '@' or '>', the serverish argument determines whether
// it is used to bind (serverish = true) or connect (serverish = false)
func (s *Sock) Attach(endpoints string, serverish bool) error {
	rc := C.zsock_attach(s.zsockT, C.CString(endpoints), C._Bool(serverish))
	if rc == -1 {
		return ErrSockAttach
	}
	return nil
}
开发者ID:roger2000,项目名称:goczmq,代码行数:12,代码来源:sock.go

示例4: CreateFrameBufferFromTextures

func CreateFrameBufferFromTextures(textures []Texture, destroyTextures bool) FrameBuffer {
	h := C.bgfx_create_frame_buffer_from_handles(
		C.uint8_t(len(textures)),
		//(*C.bgfx_texture_handle_t)(unsafe.Pointer(&textures[0])),
		&textures[0].h,
		C._Bool(destroyTextures),
	)
	return FrameBuffer{h: h}
}
开发者ID:gmacd,项目名称:go-bgfx,代码行数:9,代码来源:bridge.go

示例5: _goHandleKeyboardKey

//export _goHandleKeyboardKey
func _goHandleKeyboardKey(view C.wlc_handle, time C.uint32_t, modifiers *C.struct_wlc_modifiers, key C.uint32_t, state C.enum_wlc_key_state) C._Bool {
	return C._Bool(wlcInterface.Keyboard.Key(
		View(view),
		uint32(time),
		modsCtoGo(modifiers),
		uint32(key),
		KeyState(state),
	))
}
开发者ID:mikkeloscar,项目名称:go-wlc,代码行数:10,代码来源:interface.go

示例6: _goHandleTouchTouch

//export _goHandleTouchTouch
func _goHandleTouchTouch(view C.wlc_handle, time C.uint32_t, modifiers *C.struct_wlc_modifiers, touch C.enum_wlc_touch_type, slot C.int32_t, point *C.struct_wlc_point) C._Bool {
	return C._Bool(wlcInterface.Touch.Touch(
		View(view),
		uint32(time),
		modsCtoGo(modifiers),
		TouchType(touch),
		int32(slot),
		pointCtoGo(point),
	))
}
开发者ID:mikkeloscar,项目名称:go-wlc,代码行数:11,代码来源:interface.go

示例7: _goHandlePointerButton

//export _goHandlePointerButton
func _goHandlePointerButton(view C.wlc_handle, time C.uint32_t, modifiers *C.struct_wlc_modifiers, button C.uint32_t, state C.enum_wlc_button_state, point *C.struct_wlc_point) C._Bool {
	return C._Bool(wlcInterface.Pointer.Button(
		View(view),
		uint32(time),
		modsCtoGo(modifiers),
		uint32(button),
		ButtonState(state),
		pointCtoGo(point),
	))
}
开发者ID:mikkeloscar,项目名称:go-wlc,代码行数:11,代码来源:interface.go

示例8: Attach

// Attach attaches a socket to zero or more endpoints. If endpoints is not null,
// parses as list of ZeroMQ endpoints, separated by commas, and prefixed by
// '@' (to bind the socket) or '>' (to attach the socket). If the endpoint
// does not start with '@' or '>', the serverish argument determines whether
// it is used to bind (serverish = true) or connect (serverish = false)
func (s *Sock) Attach(endpoints string, serverish bool) error {
	cEndpoints := C.CString(endpoints)
	defer C.free(unsafe.Pointer(cEndpoints))

	rc := C.zsock_attach(s.zsockT, cEndpoints, C._Bool(serverish))
	if rc == -1 {
		return ErrSockAttach
	}
	return nil
}
开发者ID:nbargnesi,项目名称:goczmq,代码行数:15,代码来源:sock.go

示例9: Next

func (o *ObjectIter) Next() *Object {
	obj := C.ucl_iterate_object(o.object, &o.iter, C._Bool(o.expand))
	if obj == nil {
		return nil
	}

	// Increase the ref count so we have to free it
	C.ucl_object_ref(obj)

	return &Object{object: obj}
}
开发者ID:escribano,项目名称:go-libucl,代码行数:11,代码来源:object.go

示例10: detectLanguage

// detectLanguage calls the C function
func detectLanguage(text string, plain bool) *Language {
	length := C.int(len(text))
	buffer := C.CString(text)
	defer C.free(unsafe.Pointer(buffer))
	result := C.struct_language{}
	C.detect_language(buffer, length, C._Bool(plain), &result)
	return &Language{
		Code:     C.GoString(result.code),
		Name:     C.GoString(result.name),
		Reliable: result.reliable != 0,
	}
}
开发者ID:slyrz,项目名称:language,代码行数:13,代码来源:binding.go

示例11: _goHandlePointerScroll

//export _goHandlePointerScroll
func _goHandlePointerScroll(view C.wlc_handle, time C.uint32_t, modifiers *C.struct_wlc_modifiers, axisBits C.uint8_t, amount *C.double) C._Bool {
	// convert double[2] to [2]float64
	goAmount := [2]float64{
		*(*float64)(amount),
		*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(amount)) + unsafe.Sizeof(*amount))),
	}
	return C._Bool(wlcInterface.Pointer.Scroll(
		View(view),
		uint32(time),
		modsCtoGo(modifiers),
		uint8(axisBits),
		goAmount,
	))
}
开发者ID:mikkeloscar,项目名称:go-wlc,代码行数:15,代码来源:interface.go

示例12: VertexPack

func VertexPack(input [4]float32, normalized bool, attrib Attrib, decl VertexDecl, slice interface{}, index int) {
	val := reflect.ValueOf(slice)
	if val.Kind() != reflect.Slice {
		panic(errors.New("bgfx: expected slice"))
	}
	C.bgfx_vertex_pack(
		(*C.float)(unsafe.Pointer(&input)),
		C._Bool(normalized),
		C.bgfx_attrib_t(attrib),
		&decl.decl,
		unsafe.Pointer(val.Pointer()),
		C.uint32_t(index),
	)
}
开发者ID:gmacd,项目名称:go-bgfx,代码行数:14,代码来源:bridge.go

示例13: Lookup

func (db *DB) Lookup(ip string) (*LookupResult, error) {
	var gaiError, status C.int
	result := C.MMDB_lookup_string(&db.mmdb, C.CString(ip), &gaiError, &status)
	if gaiError != 0 {
		return nil, fmt.Errorf(C.GoString(C.gai_strerror(gaiError)))
	}
	if status != C.int(StatusSuccess) {
		return nil, fmt.Errorf(errorString(int(status)))
	}
	if result.found_entry != C._Bool(true) {
		return nil, fmt.Errorf("no entry for ip (%s) was found.", ip)
	}

	var entryDataList *C.MMDB_entry_data_list_s
	status = C.MMDB_get_entry_data_list(&result.entry, &entryDataList)
	if status != C.int(StatusSuccess) {
		return nil, fmt.Errorf(errorString(int(status)))
	}

	return &LookupResult{entryDataList, entryDataList}, nil
}
开发者ID:ruizu,项目名称:geoip,代码行数:21,代码来源:mmdb.go

示例14: SetSourceMapEmbed

func (opt *options) SetSourceMapEmbed(embed bool) {
	C.sass_option_set_source_map_embed(opt.optc(), C._Bool(embed))
}
开发者ID:go-gonzo,项目名称:scss,代码行数:3,代码来源:options.go

示例15: SetSourceComments

func (opt *options) SetSourceComments(comment bool) {
	C.sass_option_set_source_comments(opt.optc(), C._Bool(comment))
}
开发者ID:go-gonzo,项目名称:scss,代码行数:3,代码来源:options.go


注:本文中的C._Bool函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。