Win32 API 日本語リファレンス
ホームGlobalization › ufmt_getDecNumChars

ufmt_getDecNumChars

関数
フォーマット可能オブジェクトから十進数文字列を取得する。
DLLicuin.dll呼出規約cdecl

シグネチャ

// icuin.dll
#include <windows.h>

LPSTR ufmt_getDecNumChars(
    void** fmt,
    INT* len,
    UErrorCode* status
);

パラメーター

名前方向
fmtvoid**inout
lenINT*inout
statusUErrorCode*inout

戻り値の型: LPSTR

各言語での呼び出し定義

// icuin.dll
#include <windows.h>

LPSTR ufmt_getDecNumChars(
    void** fmt,
    INT* len,
    UErrorCode* status
);
[DllImport("icuin.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr ufmt_getDecNumChars(
    IntPtr fmt,   // void** in/out
    ref int len,   // INT* in/out
    ref int status   // UErrorCode* in/out
);
<DllImport("icuin.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ufmt_getDecNumChars(
    fmt As IntPtr,   ' void** in/out
    ByRef len As Integer,   ' INT* in/out
    ByRef status As Integer   ' UErrorCode* in/out
) As IntPtr
End Function
' fmt : void** in/out
' len : INT* in/out
' status : UErrorCode* in/out
Declare PtrSafe Function ufmt_getDecNumChars Lib "icuin" ( _
    ByVal fmt As LongPtr, _
    ByRef len As Long, _
    ByRef status As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ufmt_getDecNumChars = ctypes.cdll.icuin.ufmt_getDecNumChars
ufmt_getDecNumChars.restype = wintypes.LPSTR
ufmt_getDecNumChars.argtypes = [
    ctypes.c_void_p,  # fmt : void** in/out
    ctypes.POINTER(ctypes.c_int),  # len : INT* in/out
    ctypes.c_void_p,  # status : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuin.dll')
ufmt_getDecNumChars = Fiddle::Function.new(
  lib['ufmt_getDecNumChars'],
  [
    Fiddle::TYPE_VOIDP,  # fmt : void** in/out
    Fiddle::TYPE_VOIDP,  # len : INT* in/out
    Fiddle::TYPE_VOIDP,  # status : UErrorCode* in/out
  ],
  Fiddle::TYPE_VOIDP, Fiddle::Function::CDECL)
#[link(name = "icuin")]
extern "C" {
    fn ufmt_getDecNumChars(
        fmt: *mut *mut (),  // void** in/out
        len: *mut i32,  // INT* in/out
        status: *mut i32  // UErrorCode* in/out
    ) -> *mut u8;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr ufmt_getDecNumChars(IntPtr fmt, ref int len, ref int status);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_ufmt_getDecNumChars' -Namespace Win32 -PassThru
# $api::ufmt_getDecNumChars(fmt, len, status)
#uselib "icuin.dll"
#func global ufmt_getDecNumChars "ufmt_getDecNumChars" sptr, sptr, sptr
; ufmt_getDecNumChars fmt, varptr(len), status   ; 戻り値は stat
; fmt : void** in/out -> "sptr"
; len : INT* in/out -> "sptr"
; status : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "icuin.dll"
#cfunc global ufmt_getDecNumChars "ufmt_getDecNumChars" sptr, var, int
; res = ufmt_getDecNumChars(fmt, len, status)
; fmt : void** in/out -> "sptr"
; len : INT* in/out -> "var"
; status : UErrorCode* in/out -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; LPSTR ufmt_getDecNumChars(void** fmt, INT* len, UErrorCode* status)
#uselib "icuin.dll"
#cfunc global ufmt_getDecNumChars "ufmt_getDecNumChars" intptr, var, int
; res = ufmt_getDecNumChars(fmt, len, status)
; fmt : void** in/out -> "intptr"
; len : INT* in/out -> "var"
; status : UErrorCode* in/out -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procufmt_getDecNumChars = icuin.NewProc("ufmt_getDecNumChars")
)

// fmt (void** in/out), len (INT* in/out), status (UErrorCode* in/out)
r1, _, err := procufmt_getDecNumChars.Call(
	uintptr(fmt),
	uintptr(len),
	uintptr(status),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // LPSTR
function ufmt_getDecNumChars(
  fmt: Pointer;   // void** in/out
  len: Pointer;   // INT* in/out
  status: Pointer   // UErrorCode* in/out
): PAnsiChar; cdecl;
  external 'icuin.dll' name 'ufmt_getDecNumChars';
result := DllCall("icuin\ufmt_getDecNumChars"
    , "Ptr", fmt   ; void** in/out
    , "Ptr", len   ; INT* in/out
    , "Ptr", status   ; UErrorCode* in/out
    , "Cdecl Ptr")   ; return: LPSTR
●ufmt_getDecNumChars(fmt, len, status) = DLL("icuin.dll", "char* ufmt_getDecNumChars(void*, void*, void*)")
# 呼び出し: ufmt_getDecNumChars(fmt, len, status)
# fmt : void** in/out -> "void*"
# len : INT* in/out -> "void*"
# status : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。