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