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