ホーム › Globalization › ucal_setDateTime
ucal_setDateTime
関数カレンダーに年月日時分秒を設定する。
シグネチャ
// icuin.dll
#include <windows.h>
void ucal_setDateTime(
void** cal,
INT year,
INT month,
INT date,
INT hour,
INT minute,
INT second,
UErrorCode* status
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| cal | void** | inout |
| year | INT | in |
| month | INT | in |
| date | INT | in |
| hour | INT | in |
| minute | INT | in |
| second | INT | in |
| status | UErrorCode* | inout |
戻り値の型: void
各言語での呼び出し定義
// icuin.dll
#include <windows.h>
void ucal_setDateTime(
void** cal,
INT year,
INT month,
INT date,
INT hour,
INT minute,
INT second,
UErrorCode* status
);[DllImport("icuin.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void ucal_setDateTime(
IntPtr cal, // void** in/out
int year, // INT
int month, // INT
int date, // INT
int hour, // INT
int minute, // INT
int second, // INT
ref int status // UErrorCode* in/out
);<DllImport("icuin.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub ucal_setDateTime(
cal As IntPtr, ' void** in/out
year As Integer, ' INT
month As Integer, ' INT
[date] As Integer, ' INT
hour As Integer, ' INT
minute As Integer, ' INT
second As Integer, ' INT
ByRef status As Integer ' UErrorCode* in/out
)
End Sub' cal : void** in/out
' year : INT
' month : INT
' date : INT
' hour : INT
' minute : INT
' second : INT
' status : UErrorCode* in/out
Declare PtrSafe Sub ucal_setDateTime Lib "icuin" ( _
ByVal cal As LongPtr, _
ByVal year As Long, _
ByVal month As Long, _
ByVal date As Long, _
ByVal hour As Long, _
ByVal minute As Long, _
ByVal second As Long, _
ByRef status As Long)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ucal_setDateTime = ctypes.cdll.icuin.ucal_setDateTime
ucal_setDateTime.restype = None
ucal_setDateTime.argtypes = [
ctypes.c_void_p, # cal : void** in/out
ctypes.c_int, # year : INT
ctypes.c_int, # month : INT
ctypes.c_int, # date : INT
ctypes.c_int, # hour : INT
ctypes.c_int, # minute : INT
ctypes.c_int, # second : INT
ctypes.c_void_p, # status : UErrorCode* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuin.dll')
ucal_setDateTime = Fiddle::Function.new(
lib['ucal_setDateTime'],
[
Fiddle::TYPE_VOIDP, # cal : void** in/out
Fiddle::TYPE_INT, # year : INT
Fiddle::TYPE_INT, # month : INT
Fiddle::TYPE_INT, # date : INT
Fiddle::TYPE_INT, # hour : INT
Fiddle::TYPE_INT, # minute : INT
Fiddle::TYPE_INT, # second : INT
Fiddle::TYPE_VOIDP, # status : UErrorCode* in/out
],
Fiddle::TYPE_VOID, Fiddle::Function::CDECL)#[link(name = "icuin")]
extern "C" {
fn ucal_setDateTime(
cal: *mut *mut (), // void** in/out
year: i32, // INT
month: i32, // INT
date: i32, // INT
hour: i32, // INT
minute: i32, // INT
second: i32, // INT
status: *mut i32 // UErrorCode* in/out
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void ucal_setDateTime(IntPtr cal, int year, int month, int date, int hour, int minute, int second, ref int status);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_ucal_setDateTime' -Namespace Win32 -PassThru
# $api::ucal_setDateTime(cal, year, month, date, hour, minute, second, status)#uselib "icuin.dll"
#func global ucal_setDateTime "ucal_setDateTime" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; ucal_setDateTime cal, year, month, date, hour, minute, second, status
; cal : void** in/out -> "sptr"
; year : INT -> "sptr"
; month : INT -> "sptr"
; date : INT -> "sptr"
; hour : INT -> "sptr"
; minute : INT -> "sptr"
; second : INT -> "sptr"
; status : UErrorCode* in/out -> "sptr"#uselib "icuin.dll"
#func global ucal_setDateTime "ucal_setDateTime" sptr, int, int, int, int, int, int, int
; ucal_setDateTime cal, year, month, date, hour, minute, second, status
; cal : void** in/out -> "sptr"
; year : INT -> "int"
; month : INT -> "int"
; date : INT -> "int"
; hour : INT -> "int"
; minute : INT -> "int"
; second : INT -> "int"
; status : UErrorCode* in/out -> "int"; void ucal_setDateTime(void** cal, INT year, INT month, INT date, INT hour, INT minute, INT second, UErrorCode* status)
#uselib "icuin.dll"
#func global ucal_setDateTime "ucal_setDateTime" intptr, int, int, int, int, int, int, int
; ucal_setDateTime cal, year, month, date, hour, minute, second, status
; cal : void** in/out -> "intptr"
; year : INT -> "int"
; month : INT -> "int"
; date : INT -> "int"
; hour : INT -> "int"
; minute : INT -> "int"
; second : INT -> "int"
; status : UErrorCode* in/out -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuin = windows.NewLazySystemDLL("icuin.dll")
procucal_setDateTime = icuin.NewProc("ucal_setDateTime")
)
// cal (void** in/out), year (INT), month (INT), date (INT), hour (INT), minute (INT), second (INT), status (UErrorCode* in/out)
r1, _, err := procucal_setDateTime.Call(
uintptr(cal),
uintptr(year),
uintptr(month),
uintptr(date),
uintptr(hour),
uintptr(minute),
uintptr(second),
uintptr(status),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure ucal_setDateTime(
cal: Pointer; // void** in/out
year: Integer; // INT
month: Integer; // INT
date: Integer; // INT
hour: Integer; // INT
minute: Integer; // INT
second: Integer; // INT
status: Pointer // UErrorCode* in/out
); cdecl;
external 'icuin.dll' name 'ucal_setDateTime';result := DllCall("icuin\ucal_setDateTime"
, "Ptr", cal ; void** in/out
, "Int", year ; INT
, "Int", month ; INT
, "Int", date ; INT
, "Int", hour ; INT
, "Int", minute ; INT
, "Int", second ; INT
, "Ptr", status ; UErrorCode* in/out
, "Cdecl Int") ; return: void●ucal_setDateTime(cal, year, month, date, hour, minute, second, status) = DLL("icuin.dll", "int ucal_setDateTime(void*, int, int, int, int, int, int, void*)")
# 呼び出し: ucal_setDateTime(cal, year, month, date, hour, minute, second, status)
# cal : void** in/out -> "void*"
# year : INT -> "int"
# month : INT -> "int"
# date : INT -> "int"
# hour : INT -> "int"
# minute : INT -> "int"
# second : INT -> "int"
# status : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。