ホーム › Globalization › ubrk_getBinaryRules
ubrk_getBinaryRules
関数分割イテレータの規則をバイナリ形式で取得する。
シグネチャ
// icuuc.dll
#include <windows.h>
INT ubrk_getBinaryRules(
UBreakIterator* bi,
BYTE* binaryRules,
INT rulesCapacity,
UErrorCode* status
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| bi | UBreakIterator* | inout |
| binaryRules | BYTE* | inout |
| rulesCapacity | INT | in |
| status | UErrorCode* | inout |
戻り値の型: INT
各言語での呼び出し定義
// icuuc.dll
#include <windows.h>
INT ubrk_getBinaryRules(
UBreakIterator* bi,
BYTE* binaryRules,
INT rulesCapacity,
UErrorCode* status
);[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern int ubrk_getBinaryRules(
ref IntPtr bi, // UBreakIterator* in/out
IntPtr binaryRules, // BYTE* in/out
int rulesCapacity, // INT
ref int status // UErrorCode* in/out
);<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ubrk_getBinaryRules(
ByRef bi As IntPtr, ' UBreakIterator* in/out
binaryRules As IntPtr, ' BYTE* in/out
rulesCapacity As Integer, ' INT
ByRef status As Integer ' UErrorCode* in/out
) As Integer
End Function' bi : UBreakIterator* in/out
' binaryRules : BYTE* in/out
' rulesCapacity : INT
' status : UErrorCode* in/out
Declare PtrSafe Function ubrk_getBinaryRules Lib "icuuc" ( _
ByRef bi As LongPtr, _
ByVal binaryRules As LongPtr, _
ByVal rulesCapacity As Long, _
ByRef status As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ubrk_getBinaryRules = ctypes.cdll.icuuc.ubrk_getBinaryRules
ubrk_getBinaryRules.restype = ctypes.c_int
ubrk_getBinaryRules.argtypes = [
ctypes.c_void_p, # bi : UBreakIterator* in/out
ctypes.POINTER(ctypes.c_ubyte), # binaryRules : BYTE* in/out
ctypes.c_int, # rulesCapacity : INT
ctypes.c_void_p, # status : UErrorCode* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuuc.dll')
ubrk_getBinaryRules = Fiddle::Function.new(
lib['ubrk_getBinaryRules'],
[
Fiddle::TYPE_VOIDP, # bi : UBreakIterator* in/out
Fiddle::TYPE_VOIDP, # binaryRules : BYTE* in/out
Fiddle::TYPE_INT, # rulesCapacity : INT
Fiddle::TYPE_VOIDP, # status : UErrorCode* in/out
],
Fiddle::TYPE_INT, Fiddle::Function::CDECL)#[link(name = "icuuc")]
extern "C" {
fn ubrk_getBinaryRules(
bi: *mut isize, // UBreakIterator* in/out
binaryRules: *mut u8, // BYTE* in/out
rulesCapacity: i32, // INT
status: *mut i32 // UErrorCode* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int ubrk_getBinaryRules(ref IntPtr bi, IntPtr binaryRules, int rulesCapacity, ref int status);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_ubrk_getBinaryRules' -Namespace Win32 -PassThru
# $api::ubrk_getBinaryRules(bi, binaryRules, rulesCapacity, status)#uselib "icuuc.dll"
#func global ubrk_getBinaryRules "ubrk_getBinaryRules" sptr, sptr, sptr, sptr
; ubrk_getBinaryRules bi, varptr(binaryRules), rulesCapacity, status ; 戻り値は stat
; bi : UBreakIterator* in/out -> "sptr"
; binaryRules : BYTE* in/out -> "sptr"
; rulesCapacity : INT -> "sptr"
; status : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "icuuc.dll" #cfunc global ubrk_getBinaryRules "ubrk_getBinaryRules" int, var, int, int ; res = ubrk_getBinaryRules(bi, binaryRules, rulesCapacity, status) ; bi : UBreakIterator* in/out -> "int" ; binaryRules : BYTE* in/out -> "var" ; rulesCapacity : INT -> "int" ; status : UErrorCode* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icuuc.dll" #cfunc global ubrk_getBinaryRules "ubrk_getBinaryRules" int, sptr, int, int ; res = ubrk_getBinaryRules(bi, varptr(binaryRules), rulesCapacity, status) ; bi : UBreakIterator* in/out -> "int" ; binaryRules : BYTE* in/out -> "sptr" ; rulesCapacity : INT -> "int" ; status : UErrorCode* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; INT ubrk_getBinaryRules(UBreakIterator* bi, BYTE* binaryRules, INT rulesCapacity, UErrorCode* status) #uselib "icuuc.dll" #cfunc global ubrk_getBinaryRules "ubrk_getBinaryRules" int, var, int, int ; res = ubrk_getBinaryRules(bi, binaryRules, rulesCapacity, status) ; bi : UBreakIterator* in/out -> "int" ; binaryRules : BYTE* in/out -> "var" ; rulesCapacity : INT -> "int" ; status : UErrorCode* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; INT ubrk_getBinaryRules(UBreakIterator* bi, BYTE* binaryRules, INT rulesCapacity, UErrorCode* status) #uselib "icuuc.dll" #cfunc global ubrk_getBinaryRules "ubrk_getBinaryRules" int, intptr, int, int ; res = ubrk_getBinaryRules(bi, varptr(binaryRules), rulesCapacity, status) ; bi : UBreakIterator* in/out -> "int" ; binaryRules : BYTE* in/out -> "intptr" ; rulesCapacity : INT -> "int" ; status : UErrorCode* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuuc = windows.NewLazySystemDLL("icuuc.dll")
procubrk_getBinaryRules = icuuc.NewProc("ubrk_getBinaryRules")
)
// bi (UBreakIterator* in/out), binaryRules (BYTE* in/out), rulesCapacity (INT), status (UErrorCode* in/out)
r1, _, err := procubrk_getBinaryRules.Call(
uintptr(bi),
uintptr(binaryRules),
uintptr(rulesCapacity),
uintptr(status),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction ubrk_getBinaryRules(
bi: Pointer; // UBreakIterator* in/out
binaryRules: Pointer; // BYTE* in/out
rulesCapacity: Integer; // INT
status: Pointer // UErrorCode* in/out
): Integer; cdecl;
external 'icuuc.dll' name 'ubrk_getBinaryRules';result := DllCall("icuuc\ubrk_getBinaryRules"
, "Ptr", bi ; UBreakIterator* in/out
, "Ptr", binaryRules ; BYTE* in/out
, "Int", rulesCapacity ; INT
, "Ptr", status ; UErrorCode* in/out
, "Cdecl Int") ; return: INT●ubrk_getBinaryRules(bi, binaryRules, rulesCapacity, status) = DLL("icuuc.dll", "int ubrk_getBinaryRules(void*, void*, int, void*)")
# 呼び出し: ubrk_getBinaryRules(bi, binaryRules, rulesCapacity, status)
# bi : UBreakIterator* in/out -> "void*"
# binaryRules : BYTE* in/out -> "void*"
# rulesCapacity : INT -> "int"
# status : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。