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