ホーム › Globalization › udat_setSymbols
udat_setSymbols
関数日付書式の指定記号を設定する。
シグネチャ
// icuin.dll
#include <windows.h>
void udat_setSymbols(
void** format,
UDateFormatSymbolType type,
INT symbolIndex,
WORD* value,
INT valueLength,
UErrorCode* status
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| format | void** | inout |
| type | UDateFormatSymbolType | in |
| symbolIndex | INT | in |
| value | WORD* | inout |
| valueLength | INT | in |
| status | UErrorCode* | inout |
戻り値の型: void
各言語での呼び出し定義
// icuin.dll
#include <windows.h>
void udat_setSymbols(
void** format,
UDateFormatSymbolType type,
INT symbolIndex,
WORD* value,
INT valueLength,
UErrorCode* status
);[DllImport("icuin.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void udat_setSymbols(
IntPtr format, // void** in/out
int type, // UDateFormatSymbolType
int symbolIndex, // INT
ref ushort value, // WORD* in/out
int valueLength, // INT
ref int status // UErrorCode* in/out
);<DllImport("icuin.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub udat_setSymbols(
format As IntPtr, ' void** in/out
type As Integer, ' UDateFormatSymbolType
symbolIndex As Integer, ' INT
ByRef value As UShort, ' WORD* in/out
valueLength As Integer, ' INT
ByRef status As Integer ' UErrorCode* in/out
)
End Sub' format : void** in/out
' type : UDateFormatSymbolType
' symbolIndex : INT
' value : WORD* in/out
' valueLength : INT
' status : UErrorCode* in/out
Declare PtrSafe Sub udat_setSymbols Lib "icuin" ( _
ByVal format As LongPtr, _
ByVal type As Long, _
ByVal symbolIndex As Long, _
ByRef value As Integer, _
ByVal valueLength 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_setSymbols = ctypes.cdll.icuin.udat_setSymbols
udat_setSymbols.restype = None
udat_setSymbols.argtypes = [
ctypes.c_void_p, # format : void** in/out
ctypes.c_int, # type : UDateFormatSymbolType
ctypes.c_int, # symbolIndex : INT
ctypes.POINTER(ctypes.c_ushort), # value : WORD* in/out
ctypes.c_int, # valueLength : INT
ctypes.c_void_p, # status : UErrorCode* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuin.dll')
udat_setSymbols = Fiddle::Function.new(
lib['udat_setSymbols'],
[
Fiddle::TYPE_VOIDP, # format : void** in/out
Fiddle::TYPE_INT, # type : UDateFormatSymbolType
Fiddle::TYPE_INT, # symbolIndex : INT
Fiddle::TYPE_VOIDP, # value : WORD* in/out
Fiddle::TYPE_INT, # valueLength : INT
Fiddle::TYPE_VOIDP, # status : UErrorCode* in/out
],
Fiddle::TYPE_VOID, Fiddle::Function::CDECL)#[link(name = "icuin")]
extern "C" {
fn udat_setSymbols(
format: *mut *mut (), // void** in/out
type: i32, // UDateFormatSymbolType
symbolIndex: i32, // INT
value: *mut u16, // WORD* in/out
valueLength: 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 udat_setSymbols(IntPtr format, int type, int symbolIndex, ref ushort value, int valueLength, ref int status);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_udat_setSymbols' -Namespace Win32 -PassThru
# $api::udat_setSymbols(format, type, symbolIndex, value, valueLength, status)#uselib "icuin.dll"
#func global udat_setSymbols "udat_setSymbols" sptr, sptr, sptr, sptr, sptr, sptr
; udat_setSymbols format, type, symbolIndex, varptr(value), valueLength, status
; format : void** in/out -> "sptr"
; type : UDateFormatSymbolType -> "sptr"
; symbolIndex : INT -> "sptr"
; value : WORD* in/out -> "sptr"
; valueLength : INT -> "sptr"
; status : UErrorCode* in/out -> "sptr"出力引数:
#uselib "icuin.dll" #func global udat_setSymbols "udat_setSymbols" sptr, int, int, var, int, int ; udat_setSymbols format, type, symbolIndex, value, valueLength, status ; format : void** in/out -> "sptr" ; type : UDateFormatSymbolType -> "int" ; symbolIndex : INT -> "int" ; value : WORD* in/out -> "var" ; valueLength : INT -> "int" ; status : UErrorCode* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icuin.dll" #func global udat_setSymbols "udat_setSymbols" sptr, int, int, sptr, int, int ; udat_setSymbols format, type, symbolIndex, varptr(value), valueLength, status ; format : void** in/out -> "sptr" ; type : UDateFormatSymbolType -> "int" ; symbolIndex : INT -> "int" ; value : WORD* in/out -> "sptr" ; valueLength : INT -> "int" ; status : UErrorCode* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; void udat_setSymbols(void** format, UDateFormatSymbolType type, INT symbolIndex, WORD* value, INT valueLength, UErrorCode* status) #uselib "icuin.dll" #func global udat_setSymbols "udat_setSymbols" intptr, int, int, var, int, int ; udat_setSymbols format, type, symbolIndex, value, valueLength, status ; format : void** in/out -> "intptr" ; type : UDateFormatSymbolType -> "int" ; symbolIndex : INT -> "int" ; value : WORD* in/out -> "var" ; valueLength : INT -> "int" ; status : UErrorCode* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; void udat_setSymbols(void** format, UDateFormatSymbolType type, INT symbolIndex, WORD* value, INT valueLength, UErrorCode* status) #uselib "icuin.dll" #func global udat_setSymbols "udat_setSymbols" intptr, int, int, intptr, int, int ; udat_setSymbols format, type, symbolIndex, varptr(value), valueLength, status ; format : void** in/out -> "intptr" ; type : UDateFormatSymbolType -> "int" ; symbolIndex : INT -> "int" ; value : WORD* in/out -> "intptr" ; valueLength : INT -> "int" ; status : UErrorCode* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuin = windows.NewLazySystemDLL("icuin.dll")
procudat_setSymbols = icuin.NewProc("udat_setSymbols")
)
// format (void** in/out), type (UDateFormatSymbolType), symbolIndex (INT), value (WORD* in/out), valueLength (INT), status (UErrorCode* in/out)
r1, _, err := procudat_setSymbols.Call(
uintptr(format),
uintptr(type),
uintptr(symbolIndex),
uintptr(value),
uintptr(valueLength),
uintptr(status),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure udat_setSymbols(
format: Pointer; // void** in/out
type: Integer; // UDateFormatSymbolType
symbolIndex: Integer; // INT
value: Pointer; // WORD* in/out
valueLength: Integer; // INT
status: Pointer // UErrorCode* in/out
); cdecl;
external 'icuin.dll' name 'udat_setSymbols';result := DllCall("icuin\udat_setSymbols"
, "Ptr", format ; void** in/out
, "Int", type ; UDateFormatSymbolType
, "Int", symbolIndex ; INT
, "Ptr", value ; WORD* in/out
, "Int", valueLength ; INT
, "Ptr", status ; UErrorCode* in/out
, "Cdecl Int") ; return: void●udat_setSymbols(format, type, symbolIndex, value, valueLength, status) = DLL("icuin.dll", "int udat_setSymbols(void*, int, int, void*, int, void*)")
# 呼び出し: udat_setSymbols(format, type, symbolIndex, value, valueLength, status)
# format : void** in/out -> "void*"
# type : UDateFormatSymbolType -> "int"
# symbolIndex : INT -> "int"
# value : WORD* in/out -> "void*"
# valueLength : INT -> "int"
# status : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。