ホーム › Globalization › udatpg_addPattern
udatpg_addPattern
関数生成器に日時パターンを追加し競合を返す。
シグネチャ
// icuin.dll
#include <windows.h>
UDateTimePatternConflict udatpg_addPattern(
void** dtpg,
const WORD* pattern,
INT patternLength,
CHAR override,
WORD* conflictingPattern,
INT capacity,
INT* pLength,
UErrorCode* pErrorCode
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| dtpg | void** | inout |
| pattern | WORD* | in |
| patternLength | INT | in |
| override | CHAR | in |
| conflictingPattern | WORD* | inout |
| capacity | INT | in |
| pLength | INT* | inout |
| pErrorCode | UErrorCode* | inout |
戻り値の型: UDateTimePatternConflict
各言語での呼び出し定義
// icuin.dll
#include <windows.h>
UDateTimePatternConflict udatpg_addPattern(
void** dtpg,
const WORD* pattern,
INT patternLength,
CHAR override,
WORD* conflictingPattern,
INT capacity,
INT* pLength,
UErrorCode* pErrorCode
);[DllImport("icuin.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern int udatpg_addPattern(
IntPtr dtpg, // void** in/out
ref ushort pattern, // WORD*
int patternLength, // INT
sbyte override, // CHAR
ref ushort conflictingPattern, // WORD* in/out
int capacity, // INT
ref int pLength, // INT* in/out
ref int pErrorCode // UErrorCode* in/out
);<DllImport("icuin.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function udatpg_addPattern(
dtpg As IntPtr, ' void** in/out
ByRef pattern As UShort, ' WORD*
patternLength As Integer, ' INT
override As SByte, ' CHAR
ByRef conflictingPattern As UShort, ' WORD* in/out
capacity As Integer, ' INT
ByRef pLength As Integer, ' INT* in/out
ByRef pErrorCode As Integer ' UErrorCode* in/out
) As Integer
End Function' dtpg : void** in/out
' pattern : WORD*
' patternLength : INT
' override : CHAR
' conflictingPattern : WORD* in/out
' capacity : INT
' pLength : INT* in/out
' pErrorCode : UErrorCode* in/out
Declare PtrSafe Function udatpg_addPattern Lib "icuin" ( _
ByVal dtpg As LongPtr, _
ByRef pattern As Integer, _
ByVal patternLength As Long, _
ByVal override As Byte, _
ByRef conflictingPattern As Integer, _
ByVal capacity As Long, _
ByRef pLength As Long, _
ByRef pErrorCode As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
udatpg_addPattern = ctypes.cdll.icuin.udatpg_addPattern
udatpg_addPattern.restype = ctypes.c_int
udatpg_addPattern.argtypes = [
ctypes.c_void_p, # dtpg : void** in/out
ctypes.POINTER(ctypes.c_ushort), # pattern : WORD*
ctypes.c_int, # patternLength : INT
ctypes.c_byte, # override : CHAR
ctypes.POINTER(ctypes.c_ushort), # conflictingPattern : WORD* in/out
ctypes.c_int, # capacity : INT
ctypes.POINTER(ctypes.c_int), # pLength : INT* in/out
ctypes.c_void_p, # pErrorCode : UErrorCode* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuin.dll')
udatpg_addPattern = Fiddle::Function.new(
lib['udatpg_addPattern'],
[
Fiddle::TYPE_VOIDP, # dtpg : void** in/out
Fiddle::TYPE_VOIDP, # pattern : WORD*
Fiddle::TYPE_INT, # patternLength : INT
Fiddle::TYPE_CHAR, # override : CHAR
Fiddle::TYPE_VOIDP, # conflictingPattern : WORD* in/out
Fiddle::TYPE_INT, # capacity : INT
Fiddle::TYPE_VOIDP, # pLength : INT* in/out
Fiddle::TYPE_VOIDP, # pErrorCode : UErrorCode* in/out
],
Fiddle::TYPE_INT, Fiddle::Function::CDECL)#[link(name = "icuin")]
extern "C" {
fn udatpg_addPattern(
dtpg: *mut *mut (), // void** in/out
pattern: *const u16, // WORD*
patternLength: i32, // INT
override: i8, // CHAR
conflictingPattern: *mut u16, // WORD* in/out
capacity: i32, // INT
pLength: *mut i32, // INT* in/out
pErrorCode: *mut i32 // UErrorCode* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int udatpg_addPattern(IntPtr dtpg, ref ushort pattern, int patternLength, sbyte override, ref ushort conflictingPattern, int capacity, ref int pLength, ref int pErrorCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_udatpg_addPattern' -Namespace Win32 -PassThru
# $api::udatpg_addPattern(dtpg, pattern, patternLength, override, conflictingPattern, capacity, pLength, pErrorCode)#uselib "icuin.dll"
#func global udatpg_addPattern "udatpg_addPattern" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; udatpg_addPattern dtpg, varptr(pattern), patternLength, override, varptr(conflictingPattern), capacity, varptr(pLength), pErrorCode ; 戻り値は stat
; dtpg : void** in/out -> "sptr"
; pattern : WORD* -> "sptr"
; patternLength : INT -> "sptr"
; override : CHAR -> "sptr"
; conflictingPattern : WORD* in/out -> "sptr"
; capacity : INT -> "sptr"
; pLength : INT* in/out -> "sptr"
; pErrorCode : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "icuin.dll" #cfunc global udatpg_addPattern "udatpg_addPattern" sptr, var, int, int, var, int, var, int ; res = udatpg_addPattern(dtpg, pattern, patternLength, override, conflictingPattern, capacity, pLength, pErrorCode) ; dtpg : void** in/out -> "sptr" ; pattern : WORD* -> "var" ; patternLength : INT -> "int" ; override : CHAR -> "int" ; conflictingPattern : WORD* in/out -> "var" ; capacity : INT -> "int" ; pLength : INT* in/out -> "var" ; pErrorCode : UErrorCode* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icuin.dll" #cfunc global udatpg_addPattern "udatpg_addPattern" sptr, sptr, int, int, sptr, int, sptr, int ; res = udatpg_addPattern(dtpg, varptr(pattern), patternLength, override, varptr(conflictingPattern), capacity, varptr(pLength), pErrorCode) ; dtpg : void** in/out -> "sptr" ; pattern : WORD* -> "sptr" ; patternLength : INT -> "int" ; override : CHAR -> "int" ; conflictingPattern : WORD* in/out -> "sptr" ; capacity : INT -> "int" ; pLength : INT* in/out -> "sptr" ; pErrorCode : UErrorCode* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; UDateTimePatternConflict udatpg_addPattern(void** dtpg, WORD* pattern, INT patternLength, CHAR override, WORD* conflictingPattern, INT capacity, INT* pLength, UErrorCode* pErrorCode) #uselib "icuin.dll" #cfunc global udatpg_addPattern "udatpg_addPattern" intptr, var, int, int, var, int, var, int ; res = udatpg_addPattern(dtpg, pattern, patternLength, override, conflictingPattern, capacity, pLength, pErrorCode) ; dtpg : void** in/out -> "intptr" ; pattern : WORD* -> "var" ; patternLength : INT -> "int" ; override : CHAR -> "int" ; conflictingPattern : WORD* in/out -> "var" ; capacity : INT -> "int" ; pLength : INT* in/out -> "var" ; pErrorCode : UErrorCode* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; UDateTimePatternConflict udatpg_addPattern(void** dtpg, WORD* pattern, INT patternLength, CHAR override, WORD* conflictingPattern, INT capacity, INT* pLength, UErrorCode* pErrorCode) #uselib "icuin.dll" #cfunc global udatpg_addPattern "udatpg_addPattern" intptr, intptr, int, int, intptr, int, intptr, int ; res = udatpg_addPattern(dtpg, varptr(pattern), patternLength, override, varptr(conflictingPattern), capacity, varptr(pLength), pErrorCode) ; dtpg : void** in/out -> "intptr" ; pattern : WORD* -> "intptr" ; patternLength : INT -> "int" ; override : CHAR -> "int" ; conflictingPattern : WORD* in/out -> "intptr" ; capacity : INT -> "int" ; pLength : INT* in/out -> "intptr" ; pErrorCode : UErrorCode* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuin = windows.NewLazySystemDLL("icuin.dll")
procudatpg_addPattern = icuin.NewProc("udatpg_addPattern")
)
// dtpg (void** in/out), pattern (WORD*), patternLength (INT), override (CHAR), conflictingPattern (WORD* in/out), capacity (INT), pLength (INT* in/out), pErrorCode (UErrorCode* in/out)
r1, _, err := procudatpg_addPattern.Call(
uintptr(dtpg),
uintptr(pattern),
uintptr(patternLength),
uintptr(override),
uintptr(conflictingPattern),
uintptr(capacity),
uintptr(pLength),
uintptr(pErrorCode),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // UDateTimePatternConflictfunction udatpg_addPattern(
dtpg: Pointer; // void** in/out
pattern: Pointer; // WORD*
patternLength: Integer; // INT
override: Shortint; // CHAR
conflictingPattern: Pointer; // WORD* in/out
capacity: Integer; // INT
pLength: Pointer; // INT* in/out
pErrorCode: Pointer // UErrorCode* in/out
): Integer; cdecl;
external 'icuin.dll' name 'udatpg_addPattern';result := DllCall("icuin\udatpg_addPattern"
, "Ptr", dtpg ; void** in/out
, "Ptr", pattern ; WORD*
, "Int", patternLength ; INT
, "Char", override ; CHAR
, "Ptr", conflictingPattern ; WORD* in/out
, "Int", capacity ; INT
, "Ptr", pLength ; INT* in/out
, "Ptr", pErrorCode ; UErrorCode* in/out
, "Cdecl Int") ; return: UDateTimePatternConflict●udatpg_addPattern(dtpg, pattern, patternLength, override, conflictingPattern, capacity, pLength, pErrorCode) = DLL("icuin.dll", "int udatpg_addPattern(void*, void*, int, char, void*, int, void*, void*)")
# 呼び出し: udatpg_addPattern(dtpg, pattern, patternLength, override, conflictingPattern, capacity, pLength, pErrorCode)
# dtpg : void** in/out -> "void*"
# pattern : WORD* -> "void*"
# patternLength : INT -> "int"
# override : CHAR -> "char"
# conflictingPattern : WORD* in/out -> "void*"
# capacity : INT -> "int"
# pLength : INT* in/out -> "void*"
# pErrorCode : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。