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