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