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