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