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