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