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