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

ucal_setDate

関数
カレンダーに年月日を設定する。
DLLicuin.dll呼出規約cdecl

シグネチャ

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

void ucal_setDate(
    void** cal,
    INT year,
    INT month,
    INT date,
    UErrorCode* status
);

パラメーター

名前方向
calvoid**inout
yearINTin
monthINTin
dateINTin
statusUErrorCode*inout

戻り値の型: void

各言語での呼び出し定義

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

void ucal_setDate(
    void** cal,
    INT year,
    INT month,
    INT date,
    UErrorCode* status
);
[DllImport("icuin.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void ucal_setDate(
    IntPtr cal,   // void** in/out
    int year,   // INT
    int month,   // INT
    int date,   // INT
    ref int status   // UErrorCode* in/out
);
<DllImport("icuin.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub ucal_setDate(
    cal As IntPtr,   ' void** in/out
    year As Integer,   ' INT
    month As Integer,   ' INT
    [date] As Integer,   ' INT
    ByRef status As Integer   ' UErrorCode* in/out
)
End Sub
' cal : void** in/out
' year : INT
' month : INT
' date : INT
' status : UErrorCode* in/out
Declare PtrSafe Sub ucal_setDate Lib "icuin" ( _
    ByVal cal As LongPtr, _
    ByVal year As Long, _
    ByVal month As Long, _
    ByVal date 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_setDate = ctypes.cdll.icuin.ucal_setDate
ucal_setDate.restype = None
ucal_setDate.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_void_p,  # status : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuin.dll')
ucal_setDate = Fiddle::Function.new(
  lib['ucal_setDate'],
  [
    Fiddle::TYPE_VOIDP,  # cal : void** in/out
    Fiddle::TYPE_INT,  # year : INT
    Fiddle::TYPE_INT,  # month : INT
    Fiddle::TYPE_INT,  # date : INT
    Fiddle::TYPE_VOIDP,  # status : UErrorCode* in/out
  ],
  Fiddle::TYPE_VOID, Fiddle::Function::CDECL)
#[link(name = "icuin")]
extern "C" {
    fn ucal_setDate(
        cal: *mut *mut (),  // void** in/out
        year: i32,  // INT
        month: i32,  // INT
        date: 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_setDate(IntPtr cal, int year, int month, int date, ref int status);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_ucal_setDate' -Namespace Win32 -PassThru
# $api::ucal_setDate(cal, year, month, date, status)
#uselib "icuin.dll"
#func global ucal_setDate "ucal_setDate" sptr, sptr, sptr, sptr, sptr
; ucal_setDate cal, year, month, date, status
; cal : void** in/out -> "sptr"
; year : INT -> "sptr"
; month : INT -> "sptr"
; date : INT -> "sptr"
; status : UErrorCode* in/out -> "sptr"
#uselib "icuin.dll"
#func global ucal_setDate "ucal_setDate" sptr, int, int, int, int
; ucal_setDate cal, year, month, date, status
; cal : void** in/out -> "sptr"
; year : INT -> "int"
; month : INT -> "int"
; date : INT -> "int"
; status : UErrorCode* in/out -> "int"
; void ucal_setDate(void** cal, INT year, INT month, INT date, UErrorCode* status)
#uselib "icuin.dll"
#func global ucal_setDate "ucal_setDate" intptr, int, int, int, int
; ucal_setDate cal, year, month, date, status
; cal : void** in/out -> "intptr"
; year : INT -> "int"
; month : INT -> "int"
; date : INT -> "int"
; status : UErrorCode* in/out -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procucal_setDate = icuin.NewProc("ucal_setDate")
)

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