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

utrans_openU

関数
規則からトランスリテレータを生成する。
DLLicuin.dll呼出規約cdecl

シグネチャ

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

void** utrans_openU(
    const WORD* id,
    INT idLength,
    UTransDirection dir,
    const WORD* rules,
    INT rulesLength,
    UParseError* parseError,
    UErrorCode* pErrorCode
);

パラメーター

名前方向
idWORD*in
idLengthINTin
dirUTransDirectionin
rulesWORD*in
rulesLengthINTin
parseErrorUParseError*inout
pErrorCodeUErrorCode*inout

戻り値の型: void**

各言語での呼び出し定義

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

void** utrans_openU(
    const WORD* id,
    INT idLength,
    UTransDirection dir,
    const WORD* rules,
    INT rulesLength,
    UParseError* parseError,
    UErrorCode* pErrorCode
);
[DllImport("icuin.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr utrans_openU(
    ref ushort id,   // WORD*
    int idLength,   // INT
    int dir,   // UTransDirection
    ref ushort rules,   // WORD*
    int rulesLength,   // INT
    IntPtr parseError,   // UParseError* in/out
    ref int pErrorCode   // UErrorCode* in/out
);
<DllImport("icuin.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function utrans_openU(
    ByRef id As UShort,   ' WORD*
    idLength As Integer,   ' INT
    dir As Integer,   ' UTransDirection
    ByRef rules As UShort,   ' WORD*
    rulesLength As Integer,   ' INT
    parseError As IntPtr,   ' UParseError* in/out
    ByRef pErrorCode As Integer   ' UErrorCode* in/out
) As IntPtr
End Function
' id : WORD*
' idLength : INT
' dir : UTransDirection
' rules : WORD*
' rulesLength : INT
' parseError : UParseError* in/out
' pErrorCode : UErrorCode* in/out
Declare PtrSafe Function utrans_openU Lib "icuin" ( _
    ByRef id As Integer, _
    ByVal idLength As Long, _
    ByVal dir As Long, _
    ByRef rules As Integer, _
    ByVal rulesLength As Long, _
    ByVal parseError As LongPtr, _
    ByRef pErrorCode As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

utrans_openU = ctypes.cdll.icuin.utrans_openU
utrans_openU.restype = ctypes.c_void_p
utrans_openU.argtypes = [
    ctypes.POINTER(ctypes.c_ushort),  # id : WORD*
    ctypes.c_int,  # idLength : INT
    ctypes.c_int,  # dir : UTransDirection
    ctypes.POINTER(ctypes.c_ushort),  # rules : WORD*
    ctypes.c_int,  # rulesLength : INT
    ctypes.c_void_p,  # parseError : UParseError* in/out
    ctypes.c_void_p,  # pErrorCode : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuin.dll')
utrans_openU = Fiddle::Function.new(
  lib['utrans_openU'],
  [
    Fiddle::TYPE_VOIDP,  # id : WORD*
    Fiddle::TYPE_INT,  # idLength : INT
    Fiddle::TYPE_INT,  # dir : UTransDirection
    Fiddle::TYPE_VOIDP,  # rules : WORD*
    Fiddle::TYPE_INT,  # rulesLength : INT
    Fiddle::TYPE_VOIDP,  # parseError : UParseError* in/out
    Fiddle::TYPE_VOIDP,  # pErrorCode : UErrorCode* in/out
  ],
  Fiddle::TYPE_VOIDP, Fiddle::Function::CDECL)
#[link(name = "icuin")]
extern "C" {
    fn utrans_openU(
        id: *const u16,  // WORD*
        idLength: i32,  // INT
        dir: i32,  // UTransDirection
        rules: *const u16,  // WORD*
        rulesLength: i32,  // INT
        parseError: *mut UParseError,  // UParseError* in/out
        pErrorCode: *mut i32  // UErrorCode* in/out
    ) -> *mut *mut ();
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr utrans_openU(ref ushort id, int idLength, int dir, ref ushort rules, int rulesLength, IntPtr parseError, ref int pErrorCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_utrans_openU' -Namespace Win32 -PassThru
# $api::utrans_openU(id, idLength, dir, rules, rulesLength, parseError, pErrorCode)
#uselib "icuin.dll"
#func global utrans_openU "utrans_openU" sptr, sptr, sptr, sptr, sptr, sptr, sptr
; utrans_openU varptr(id), idLength, dir, varptr(rules), rulesLength, varptr(parseError), pErrorCode   ; 戻り値は stat
; id : WORD* -> "sptr"
; idLength : INT -> "sptr"
; dir : UTransDirection -> "sptr"
; rules : WORD* -> "sptr"
; rulesLength : INT -> "sptr"
; parseError : UParseError* in/out -> "sptr"
; pErrorCode : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "icuin.dll"
#cfunc global utrans_openU "utrans_openU" var, int, int, var, int, var, int
; res = utrans_openU(id, idLength, dir, rules, rulesLength, parseError, pErrorCode)
; id : WORD* -> "var"
; idLength : INT -> "int"
; dir : UTransDirection -> "int"
; rules : WORD* -> "var"
; rulesLength : INT -> "int"
; parseError : UParseError* in/out -> "var"
; pErrorCode : UErrorCode* in/out -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; void** utrans_openU(WORD* id, INT idLength, UTransDirection dir, WORD* rules, INT rulesLength, UParseError* parseError, UErrorCode* pErrorCode)
#uselib "icuin.dll"
#cfunc global utrans_openU "utrans_openU" var, int, int, var, int, var, int
; res = utrans_openU(id, idLength, dir, rules, rulesLength, parseError, pErrorCode)
; id : WORD* -> "var"
; idLength : INT -> "int"
; dir : UTransDirection -> "int"
; rules : WORD* -> "var"
; rulesLength : INT -> "int"
; parseError : UParseError* in/out -> "var"
; pErrorCode : UErrorCode* in/out -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procutrans_openU = icuin.NewProc("utrans_openU")
)

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