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