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