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

ures_getInt

関数
リソースバンドルから整数値を取得する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

INT ures_getInt(
    const UResourceBundle* resourceBundle,
    UErrorCode* status
);

パラメーター

名前方向
resourceBundleUResourceBundle*in
statusUErrorCode*inout

戻り値の型: INT

各言語での呼び出し定義

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

INT ures_getInt(
    const UResourceBundle* resourceBundle,
    UErrorCode* status
);
[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern int ures_getInt(
    ref IntPtr resourceBundle,   // UResourceBundle*
    ref int status   // UErrorCode* in/out
);
<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ures_getInt(
    ByRef resourceBundle As IntPtr,   ' UResourceBundle*
    ByRef status As Integer   ' UErrorCode* in/out
) As Integer
End Function
' resourceBundle : UResourceBundle*
' status : UErrorCode* in/out
Declare PtrSafe Function ures_getInt Lib "icuuc" ( _
    ByRef resourceBundle 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

ures_getInt = ctypes.cdll.icuuc.ures_getInt
ures_getInt.restype = ctypes.c_int
ures_getInt.argtypes = [
    ctypes.c_void_p,  # resourceBundle : UResourceBundle*
    ctypes.c_void_p,  # status : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procures_getInt = icuuc.NewProc("ures_getInt")
)

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