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