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

ulistfmt_resultAsValue

関数
リストの整形結果を整形済み値として取得する。
DLLicu.dll呼出規約cdecl

シグネチャ

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

UFormattedValue* ulistfmt_resultAsValue(
    const UFormattedList* uresult,
    UErrorCode* ec
);

パラメーター

名前方向
uresultUFormattedList*in
ecUErrorCode*inout

戻り値の型: UFormattedValue*

各言語での呼び出し定義

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

UFormattedValue* ulistfmt_resultAsValue(
    const UFormattedList* uresult,
    UErrorCode* ec
);
[DllImport("icu.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr ulistfmt_resultAsValue(
    ref IntPtr uresult,   // UFormattedList*
    ref int ec   // UErrorCode* in/out
);
<DllImport("icu.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ulistfmt_resultAsValue(
    ByRef uresult As IntPtr,   ' UFormattedList*
    ByRef ec As Integer   ' UErrorCode* in/out
) As IntPtr
End Function
' uresult : UFormattedList*
' ec : UErrorCode* in/out
Declare PtrSafe Function ulistfmt_resultAsValue Lib "icu" ( _
    ByRef uresult As LongPtr, _
    ByRef ec As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ulistfmt_resultAsValue = ctypes.cdll.icu.ulistfmt_resultAsValue
ulistfmt_resultAsValue.restype = ctypes.c_void_p
ulistfmt_resultAsValue.argtypes = [
    ctypes.c_void_p,  # uresult : UFormattedList*
    ctypes.c_void_p,  # ec : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icu.dll')
ulistfmt_resultAsValue = Fiddle::Function.new(
  lib['ulistfmt_resultAsValue'],
  [
    Fiddle::TYPE_VOIDP,  # uresult : UFormattedList*
    Fiddle::TYPE_VOIDP,  # ec : UErrorCode* in/out
  ],
  Fiddle::TYPE_VOIDP, Fiddle::Function::CDECL)
#[link(name = "icu")]
extern "C" {
    fn ulistfmt_resultAsValue(
        uresult: *const isize,  // UFormattedList*
        ec: *mut i32  // UErrorCode* in/out
    ) -> *mut isize;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icu.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr ulistfmt_resultAsValue(ref IntPtr uresult, ref int ec);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icu_ulistfmt_resultAsValue' -Namespace Win32 -PassThru
# $api::ulistfmt_resultAsValue(uresult, ec)
#uselib "icu.dll"
#func global ulistfmt_resultAsValue "ulistfmt_resultAsValue" sptr, sptr
; ulistfmt_resultAsValue uresult, ec   ; 戻り値は stat
; uresult : UFormattedList* -> "sptr"
; ec : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "icu.dll"
#cfunc global ulistfmt_resultAsValue "ulistfmt_resultAsValue" int, int
; res = ulistfmt_resultAsValue(uresult, ec)
; uresult : UFormattedList* -> "int"
; ec : UErrorCode* in/out -> "int"
; UFormattedValue* ulistfmt_resultAsValue(UFormattedList* uresult, UErrorCode* ec)
#uselib "icu.dll"
#cfunc global ulistfmt_resultAsValue "ulistfmt_resultAsValue" int, int
; res = ulistfmt_resultAsValue(uresult, ec)
; uresult : UFormattedList* -> "int"
; ec : UErrorCode* in/out -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icu = windows.NewLazySystemDLL("icu.dll")
	proculistfmt_resultAsValue = icu.NewProc("ulistfmt_resultAsValue")
)

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