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