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

ucal_openCountryTimeZones

関数
指定した国のタイムゾーンIDの列挙子を開く。
DLLicuin.dll呼出規約cdecl

シグネチャ

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

UEnumeration* ucal_openCountryTimeZones(
    LPCSTR country,
    UErrorCode* ec
);

パラメーター

名前方向説明
countryLPCSTRinタイムゾーンを列挙する対象の国コード(ISO 3166)。
ecUErrorCode*inoutICUエラーコードを入出力するポインタ。呼出前に成功値で初期化する。

戻り値の型: UEnumeration*

各言語での呼び出し定義

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

UEnumeration* ucal_openCountryTimeZones(
    LPCSTR country,
    UErrorCode* ec
);
[DllImport("icuin.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr ucal_openCountryTimeZones(
    [MarshalAs(UnmanagedType.LPStr)] string country,   // LPCSTR
    ref int ec   // UErrorCode* in/out
);
<DllImport("icuin.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ucal_openCountryTimeZones(
    <MarshalAs(UnmanagedType.LPStr)> country As String,   ' LPCSTR
    ByRef ec As Integer   ' UErrorCode* in/out
) As IntPtr
End Function
' country : LPCSTR
' ec : UErrorCode* in/out
Declare PtrSafe Function ucal_openCountryTimeZones Lib "icuin" ( _
    ByVal country As String, _
    ByRef ec As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ucal_openCountryTimeZones = ctypes.cdll.icuin.ucal_openCountryTimeZones
ucal_openCountryTimeZones.restype = ctypes.c_void_p
ucal_openCountryTimeZones.argtypes = [
    wintypes.LPCSTR,  # country : LPCSTR
    ctypes.c_void_p,  # ec : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procucal_openCountryTimeZones = icuin.NewProc("ucal_openCountryTimeZones")
)

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