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

utrans_trans

関数
置換可能テキストに音訳変換を適用する。
DLLicuin.dll呼出規約cdecl

シグネチャ

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

void utrans_trans(
    const void** trans,
    void** rep,
    const UReplaceableCallbacks* repFunc,
    INT start,
    INT* limit,
    UErrorCode* status
);

パラメーター

名前方向
transvoid**in
repvoid**inout
repFuncUReplaceableCallbacks*in
startINTin
limitINT*inout
statusUErrorCode*inout

戻り値の型: void

各言語での呼び出し定義

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

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

utrans_trans = ctypes.cdll.icuin.utrans_trans
utrans_trans.restype = None
utrans_trans.argtypes = [
    ctypes.c_void_p,  # trans : void**
    ctypes.c_void_p,  # rep : void** in/out
    ctypes.c_void_p,  # repFunc : UReplaceableCallbacks*
    ctypes.c_int,  # start : INT
    ctypes.POINTER(ctypes.c_int),  # limit : INT* in/out
    ctypes.c_void_p,  # status : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuin.dll')
utrans_trans = Fiddle::Function.new(
  lib['utrans_trans'],
  [
    Fiddle::TYPE_VOIDP,  # trans : void**
    Fiddle::TYPE_VOIDP,  # rep : void** in/out
    Fiddle::TYPE_VOIDP,  # repFunc : UReplaceableCallbacks*
    Fiddle::TYPE_INT,  # start : INT
    Fiddle::TYPE_VOIDP,  # limit : INT* in/out
    Fiddle::TYPE_VOIDP,  # status : UErrorCode* in/out
  ],
  Fiddle::TYPE_VOID, Fiddle::Function::CDECL)
#[link(name = "icuin")]
extern "C" {
    fn utrans_trans(
        trans: *const *const (),  // void**
        rep: *mut *mut (),  // void** in/out
        repFunc: *const UReplaceableCallbacks,  // UReplaceableCallbacks*
        start: i32,  // INT
        limit: *mut i32,  // INT* in/out
        status: *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 utrans_trans(IntPtr trans, IntPtr rep, IntPtr repFunc, int start, ref int limit, ref int status);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_utrans_trans' -Namespace Win32 -PassThru
# $api::utrans_trans(trans, rep, repFunc, start, limit, status)
#uselib "icuin.dll"
#func global utrans_trans "utrans_trans" sptr, sptr, sptr, sptr, sptr, sptr
; utrans_trans trans, rep, varptr(repFunc), start, varptr(limit), status
; trans : void** -> "sptr"
; rep : void** in/out -> "sptr"
; repFunc : UReplaceableCallbacks* -> "sptr"
; start : INT -> "sptr"
; limit : INT* in/out -> "sptr"
; status : UErrorCode* in/out -> "sptr"
出力引数:
#uselib "icuin.dll"
#func global utrans_trans "utrans_trans" sptr, sptr, var, int, var, int
; utrans_trans trans, rep, repFunc, start, limit, status
; trans : void** -> "sptr"
; rep : void** in/out -> "sptr"
; repFunc : UReplaceableCallbacks* -> "var"
; start : INT -> "int"
; limit : INT* in/out -> "var"
; status : UErrorCode* in/out -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; void utrans_trans(void** trans, void** rep, UReplaceableCallbacks* repFunc, INT start, INT* limit, UErrorCode* status)
#uselib "icuin.dll"
#func global utrans_trans "utrans_trans" intptr, intptr, var, int, var, int
; utrans_trans trans, rep, repFunc, start, limit, status
; trans : void** -> "intptr"
; rep : void** in/out -> "intptr"
; repFunc : UReplaceableCallbacks* -> "var"
; start : INT -> "int"
; limit : INT* in/out -> "var"
; status : UErrorCode* in/out -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procutrans_trans = icuin.NewProc("utrans_trans")
)

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