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

ucal_getTimeZoneTransitionDate

関数
次回または前回のタイムゾーン遷移日時を取得する。
DLLicuin.dll呼出規約cdecl

シグネチャ

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

CHAR ucal_getTimeZoneTransitionDate(
    const void** cal,
    UTimeZoneTransitionType type,
    DOUBLE* transition,
    UErrorCode* status
);

パラメーター

名前方向
calvoid**in
typeUTimeZoneTransitionTypein
transitionDOUBLE*inout
statusUErrorCode*inout

戻り値の型: CHAR

各言語での呼び出し定義

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

CHAR ucal_getTimeZoneTransitionDate(
    const void** cal,
    UTimeZoneTransitionType type,
    DOUBLE* transition,
    UErrorCode* status
);
[DllImport("icuin.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern sbyte ucal_getTimeZoneTransitionDate(
    IntPtr cal,   // void**
    int type,   // UTimeZoneTransitionType
    ref double transition,   // DOUBLE* in/out
    ref int status   // UErrorCode* in/out
);
<DllImport("icuin.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ucal_getTimeZoneTransitionDate(
    cal As IntPtr,   ' void**
    type As Integer,   ' UTimeZoneTransitionType
    ByRef transition As Double,   ' DOUBLE* in/out
    ByRef status As Integer   ' UErrorCode* in/out
) As SByte
End Function
' cal : void**
' type : UTimeZoneTransitionType
' transition : DOUBLE* in/out
' status : UErrorCode* in/out
Declare PtrSafe Function ucal_getTimeZoneTransitionDate Lib "icuin" ( _
    ByVal cal As LongPtr, _
    ByVal type As Long, _
    ByRef transition As Double, _
    ByRef status As Long) As Byte
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ucal_getTimeZoneTransitionDate = ctypes.cdll.icuin.ucal_getTimeZoneTransitionDate
ucal_getTimeZoneTransitionDate.restype = ctypes.c_byte
ucal_getTimeZoneTransitionDate.argtypes = [
    ctypes.c_void_p,  # cal : void**
    ctypes.c_int,  # type : UTimeZoneTransitionType
    ctypes.POINTER(ctypes.c_double),  # transition : DOUBLE* in/out
    ctypes.c_void_p,  # status : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuin.dll')
ucal_getTimeZoneTransitionDate = Fiddle::Function.new(
  lib['ucal_getTimeZoneTransitionDate'],
  [
    Fiddle::TYPE_VOIDP,  # cal : void**
    Fiddle::TYPE_INT,  # type : UTimeZoneTransitionType
    Fiddle::TYPE_VOIDP,  # transition : DOUBLE* in/out
    Fiddle::TYPE_VOIDP,  # status : UErrorCode* in/out
  ],
  Fiddle::TYPE_CHAR, Fiddle::Function::CDECL)
#[link(name = "icuin")]
extern "C" {
    fn ucal_getTimeZoneTransitionDate(
        cal: *const *const (),  // void**
        type: i32,  // UTimeZoneTransitionType
        transition: *mut f64,  // DOUBLE* in/out
        status: *mut i32  // UErrorCode* in/out
    ) -> i8;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern sbyte ucal_getTimeZoneTransitionDate(IntPtr cal, int type, ref double transition, ref int status);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_ucal_getTimeZoneTransitionDate' -Namespace Win32 -PassThru
# $api::ucal_getTimeZoneTransitionDate(cal, type, transition, status)
#uselib "icuin.dll"
#func global ucal_getTimeZoneTransitionDate "ucal_getTimeZoneTransitionDate" sptr, sptr, sptr, sptr
; ucal_getTimeZoneTransitionDate cal, type, varptr(transition), status   ; 戻り値は stat
; cal : void** -> "sptr"
; type : UTimeZoneTransitionType -> "sptr"
; transition : DOUBLE* in/out -> "sptr"
; status : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "icuin.dll"
#cfunc global ucal_getTimeZoneTransitionDate "ucal_getTimeZoneTransitionDate" sptr, int, var, int
; res = ucal_getTimeZoneTransitionDate(cal, type, transition, status)
; cal : void** -> "sptr"
; type : UTimeZoneTransitionType -> "int"
; transition : DOUBLE* in/out -> "var"
; status : UErrorCode* in/out -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; CHAR ucal_getTimeZoneTransitionDate(void** cal, UTimeZoneTransitionType type, DOUBLE* transition, UErrorCode* status)
#uselib "icuin.dll"
#cfunc global ucal_getTimeZoneTransitionDate "ucal_getTimeZoneTransitionDate" intptr, int, var, int
; res = ucal_getTimeZoneTransitionDate(cal, type, transition, status)
; cal : void** -> "intptr"
; type : UTimeZoneTransitionType -> "int"
; transition : DOUBLE* in/out -> "var"
; status : UErrorCode* in/out -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procucal_getTimeZoneTransitionDate = icuin.NewProc("ucal_getTimeZoneTransitionDate")
)

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