本文整理匯總了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),
)
}
示例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),
))
}
示例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
}
示例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}
}
示例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),
))
}
示例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),
))
}
示例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),
))
}
示例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
}
示例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}
}
示例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,
}
}
示例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,
))
}
示例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),
)
}
示例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
}
示例14: SetSourceMapEmbed
func (opt *options) SetSourceMapEmbed(embed bool) {
C.sass_option_set_source_map_embed(opt.optc(), C._Bool(embed))
}
示例15: SetSourceComments
func (opt *options) SetSourceComments(comment bool) {
C.sass_option_set_source_comments(opt.optc(), C._Bool(comment))
}