當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。