Win32 API 日本語リファレンス
ホームGlobalization › ucol_setReorderCodes

ucol_setReorderCodes

関数
コレータの並べ替えスクリプトコードを設定する。
DLLicuin.dll呼出規約cdecl

シグネチャ

// icuin.dll
#include <windows.h>

void ucol_setReorderCodes(
    UCollator* coll,
    const INT* reorderCodes,
    INT reorderCodesLength,
    UErrorCode* pErrorCode
);

パラメーター

名前方向
collUCollator*inout
reorderCodesINT*in
reorderCodesLengthINTin
pErrorCodeUErrorCode*inout

戻り値の型: void

各言語での呼び出し定義

// icuin.dll
#include <windows.h>

void ucol_setReorderCodes(
    UCollator* coll,
    const INT* reorderCodes,
    INT reorderCodesLength,
    UErrorCode* pErrorCode
);
[DllImport("icuin.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void ucol_setReorderCodes(
    ref IntPtr coll,   // UCollator* in/out
    ref int reorderCodes,   // INT*
    int reorderCodesLength,   // INT
    ref int pErrorCode   // UErrorCode* in/out
);
<DllImport("icuin.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub ucol_setReorderCodes(
    ByRef coll As IntPtr,   ' UCollator* in/out
    ByRef reorderCodes As Integer,   ' INT*
    reorderCodesLength As Integer,   ' INT
    ByRef pErrorCode As Integer   ' UErrorCode* in/out
)
End Sub
' coll : UCollator* in/out
' reorderCodes : INT*
' reorderCodesLength : INT
' pErrorCode : UErrorCode* in/out
Declare PtrSafe Sub ucol_setReorderCodes Lib "icuin" ( _
    ByRef coll As LongPtr, _
    ByRef reorderCodes As Long, _
    ByVal reorderCodesLength As Long, _
    ByRef pErrorCode As Long)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ucol_setReorderCodes = ctypes.cdll.icuin.ucol_setReorderCodes
ucol_setReorderCodes.restype = None
ucol_setReorderCodes.argtypes = [
    ctypes.c_void_p,  # coll : UCollator* in/out
    ctypes.POINTER(ctypes.c_int),  # reorderCodes : INT*
    ctypes.c_int,  # reorderCodesLength : INT
    ctypes.c_void_p,  # pErrorCode : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuin.dll')
ucol_setReorderCodes = Fiddle::Function.new(
  lib['ucol_setReorderCodes'],
  [
    Fiddle::TYPE_VOIDP,  # coll : UCollator* in/out
    Fiddle::TYPE_VOIDP,  # reorderCodes : INT*
    Fiddle::TYPE_INT,  # reorderCodesLength : INT
    Fiddle::TYPE_VOIDP,  # pErrorCode : UErrorCode* in/out
  ],
  Fiddle::TYPE_VOID, Fiddle::Function::CDECL)
#[link(name = "icuin")]
extern "C" {
    fn ucol_setReorderCodes(
        coll: *mut isize,  // UCollator* in/out
        reorderCodes: *const i32,  // INT*
        reorderCodesLength: i32,  // INT
        pErrorCode: *mut i32  // UErrorCode* in/out
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void ucol_setReorderCodes(ref IntPtr coll, ref int reorderCodes, int reorderCodesLength, ref int pErrorCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_ucol_setReorderCodes' -Namespace Win32 -PassThru
# $api::ucol_setReorderCodes(coll, reorderCodes, reorderCodesLength, pErrorCode)
#uselib "icuin.dll"
#func global ucol_setReorderCodes "ucol_setReorderCodes" sptr, sptr, sptr, sptr
; ucol_setReorderCodes coll, varptr(reorderCodes), reorderCodesLength, pErrorCode
; coll : UCollator* in/out -> "sptr"
; reorderCodes : INT* -> "sptr"
; reorderCodesLength : INT -> "sptr"
; pErrorCode : UErrorCode* in/out -> "sptr"
出力引数:
#uselib "icuin.dll"
#func global ucol_setReorderCodes "ucol_setReorderCodes" int, var, int, int
; ucol_setReorderCodes coll, reorderCodes, reorderCodesLength, pErrorCode
; coll : UCollator* in/out -> "int"
; reorderCodes : INT* -> "var"
; reorderCodesLength : INT -> "int"
; pErrorCode : UErrorCode* in/out -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; void ucol_setReorderCodes(UCollator* coll, INT* reorderCodes, INT reorderCodesLength, UErrorCode* pErrorCode)
#uselib "icuin.dll"
#func global ucol_setReorderCodes "ucol_setReorderCodes" int, var, int, int
; ucol_setReorderCodes coll, reorderCodes, reorderCodesLength, pErrorCode
; coll : UCollator* in/out -> "int"
; reorderCodes : INT* -> "var"
; reorderCodesLength : INT -> "int"
; pErrorCode : UErrorCode* in/out -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procucol_setReorderCodes = icuin.NewProc("ucol_setReorderCodes")
)

// coll (UCollator* in/out), reorderCodes (INT*), reorderCodesLength (INT), pErrorCode (UErrorCode* in/out)
r1, _, err := procucol_setReorderCodes.Call(
	uintptr(coll),
	uintptr(reorderCodes),
	uintptr(reorderCodesLength),
	uintptr(pErrorCode),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // void
procedure ucol_setReorderCodes(
  coll: Pointer;   // UCollator* in/out
  reorderCodes: Pointer;   // INT*
  reorderCodesLength: Integer;   // INT
  pErrorCode: Pointer   // UErrorCode* in/out
); cdecl;
  external 'icuin.dll' name 'ucol_setReorderCodes';
result := DllCall("icuin\ucol_setReorderCodes"
    , "Ptr", coll   ; UCollator* in/out
    , "Ptr", reorderCodes   ; INT*
    , "Int", reorderCodesLength   ; INT
    , "Ptr", pErrorCode   ; UErrorCode* in/out
    , "Cdecl Int")   ; return: void
●ucol_setReorderCodes(coll, reorderCodes, reorderCodesLength, pErrorCode) = DLL("icuin.dll", "int ucol_setReorderCodes(void*, void*, int, void*)")
# 呼び出し: ucol_setReorderCodes(coll, reorderCodes, reorderCodesLength, pErrorCode)
# coll : UCollator* in/out -> "void*"
# reorderCodes : INT* -> "void*"
# reorderCodesLength : INT -> "int"
# pErrorCode : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。