ホーム › Globalization › ucnv_getPlatform
ucnv_getPlatform
関数変換器が対象とするプラットフォームを取得する。
シグネチャ
// icuuc.dll
#include <windows.h>
UConverterPlatform ucnv_getPlatform(
const UConverter* converter,
UErrorCode* err
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| converter | UConverter* | in |
| err | UErrorCode* | inout |
戻り値の型: UConverterPlatform
各言語での呼び出し定義
// icuuc.dll
#include <windows.h>
UConverterPlatform ucnv_getPlatform(
const UConverter* converter,
UErrorCode* err
);[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern int ucnv_getPlatform(
ref IntPtr converter, // UConverter*
ref int err // UErrorCode* in/out
);<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ucnv_getPlatform(
ByRef converter As IntPtr, ' UConverter*
ByRef err As Integer ' UErrorCode* in/out
) As Integer
End Function' converter : UConverter*
' err : UErrorCode* in/out
Declare PtrSafe Function ucnv_getPlatform Lib "icuuc" ( _
ByRef converter As LongPtr, _
ByRef err As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ucnv_getPlatform = ctypes.cdll.icuuc.ucnv_getPlatform
ucnv_getPlatform.restype = ctypes.c_int
ucnv_getPlatform.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_getPlatform = Fiddle::Function.new(
lib['ucnv_getPlatform'],
[
Fiddle::TYPE_VOIDP, # converter : UConverter*
Fiddle::TYPE_VOIDP, # err : UErrorCode* in/out
],
Fiddle::TYPE_INT, Fiddle::Function::CDECL)#[link(name = "icuuc")]
extern "C" {
fn ucnv_getPlatform(
converter: *const isize, // UConverter*
err: *mut i32 // UErrorCode* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int ucnv_getPlatform(ref IntPtr converter, ref int err);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_ucnv_getPlatform' -Namespace Win32 -PassThru
# $api::ucnv_getPlatform(converter, err)#uselib "icuuc.dll"
#func global ucnv_getPlatform "ucnv_getPlatform" sptr, sptr
; ucnv_getPlatform converter, err ; 戻り値は stat
; converter : UConverter* -> "sptr"
; err : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "icuuc.dll"
#cfunc global ucnv_getPlatform "ucnv_getPlatform" int, int
; res = ucnv_getPlatform(converter, err)
; converter : UConverter* -> "int"
; err : UErrorCode* in/out -> "int"; UConverterPlatform ucnv_getPlatform(UConverter* converter, UErrorCode* err)
#uselib "icuuc.dll"
#cfunc global ucnv_getPlatform "ucnv_getPlatform" int, int
; res = ucnv_getPlatform(converter, err)
; converter : UConverter* -> "int"
; err : UErrorCode* in/out -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuuc = windows.NewLazySystemDLL("icuuc.dll")
procucnv_getPlatform = icuuc.NewProc("ucnv_getPlatform")
)
// converter (UConverter*), err (UErrorCode* in/out)
r1, _, err := procucnv_getPlatform.Call(
uintptr(converter),
uintptr(err),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // UConverterPlatformfunction ucnv_getPlatform(
converter: Pointer; // UConverter*
err: Pointer // UErrorCode* in/out
): Integer; cdecl;
external 'icuuc.dll' name 'ucnv_getPlatform';result := DllCall("icuuc\ucnv_getPlatform"
, "Ptr", converter ; UConverter*
, "Ptr", err ; UErrorCode* in/out
, "Cdecl Int") ; return: UConverterPlatform●ucnv_getPlatform(converter, err) = DLL("icuuc.dll", "int ucnv_getPlatform(void*, void*)")
# 呼び出し: ucnv_getPlatform(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`,…) を使用。