ホーム › Globalization › ucfpos_matchesField
ucfpos_matchesField
関数指定カテゴリとフィールドに一致するか判定する。
シグネチャ
// icu.dll
#include <windows.h>
CHAR ucfpos_matchesField(
const UConstrainedFieldPosition* ucfpos,
INT category,
INT field,
UErrorCode* ec
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| ucfpos | UConstrainedFieldPosition* | in |
| category | INT | in |
| field | INT | in |
| ec | UErrorCode* | inout |
戻り値の型: CHAR
各言語での呼び出し定義
// icu.dll
#include <windows.h>
CHAR ucfpos_matchesField(
const UConstrainedFieldPosition* ucfpos,
INT category,
INT field,
UErrorCode* ec
);[DllImport("icu.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern sbyte ucfpos_matchesField(
ref IntPtr ucfpos, // UConstrainedFieldPosition*
int category, // INT
int field, // INT
ref int ec // UErrorCode* in/out
);<DllImport("icu.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ucfpos_matchesField(
ByRef ucfpos As IntPtr, ' UConstrainedFieldPosition*
category As Integer, ' INT
field As Integer, ' INT
ByRef ec As Integer ' UErrorCode* in/out
) As SByte
End Function' ucfpos : UConstrainedFieldPosition*
' category : INT
' field : INT
' ec : UErrorCode* in/out
Declare PtrSafe Function ucfpos_matchesField Lib "icu" ( _
ByRef ucfpos As LongPtr, _
ByVal category As Long, _
ByVal field As Long, _
ByRef ec As Long) As Byte
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ucfpos_matchesField = ctypes.cdll.icu.ucfpos_matchesField
ucfpos_matchesField.restype = ctypes.c_byte
ucfpos_matchesField.argtypes = [
ctypes.c_void_p, # ucfpos : UConstrainedFieldPosition*
ctypes.c_int, # category : INT
ctypes.c_int, # field : INT
ctypes.c_void_p, # ec : UErrorCode* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icu.dll')
ucfpos_matchesField = Fiddle::Function.new(
lib['ucfpos_matchesField'],
[
Fiddle::TYPE_VOIDP, # ucfpos : UConstrainedFieldPosition*
Fiddle::TYPE_INT, # category : INT
Fiddle::TYPE_INT, # field : INT
Fiddle::TYPE_VOIDP, # ec : UErrorCode* in/out
],
Fiddle::TYPE_CHAR, Fiddle::Function::CDECL)#[link(name = "icu")]
extern "C" {
fn ucfpos_matchesField(
ucfpos: *const isize, // UConstrainedFieldPosition*
category: i32, // INT
field: i32, // INT
ec: *mut i32 // UErrorCode* in/out
) -> i8;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icu.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern sbyte ucfpos_matchesField(ref IntPtr ucfpos, int category, int field, ref int ec);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icu_ucfpos_matchesField' -Namespace Win32 -PassThru
# $api::ucfpos_matchesField(ucfpos, category, field, ec)#uselib "icu.dll"
#func global ucfpos_matchesField "ucfpos_matchesField" sptr, sptr, sptr, sptr
; ucfpos_matchesField ucfpos, category, field, ec ; 戻り値は stat
; ucfpos : UConstrainedFieldPosition* -> "sptr"
; category : INT -> "sptr"
; field : INT -> "sptr"
; ec : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "icu.dll"
#cfunc global ucfpos_matchesField "ucfpos_matchesField" int, int, int, int
; res = ucfpos_matchesField(ucfpos, category, field, ec)
; ucfpos : UConstrainedFieldPosition* -> "int"
; category : INT -> "int"
; field : INT -> "int"
; ec : UErrorCode* in/out -> "int"; CHAR ucfpos_matchesField(UConstrainedFieldPosition* ucfpos, INT category, INT field, UErrorCode* ec)
#uselib "icu.dll"
#cfunc global ucfpos_matchesField "ucfpos_matchesField" int, int, int, int
; res = ucfpos_matchesField(ucfpos, category, field, ec)
; ucfpos : UConstrainedFieldPosition* -> "int"
; category : INT -> "int"
; field : INT -> "int"
; ec : UErrorCode* in/out -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icu = windows.NewLazySystemDLL("icu.dll")
procucfpos_matchesField = icu.NewProc("ucfpos_matchesField")
)
// ucfpos (UConstrainedFieldPosition*), category (INT), field (INT), ec (UErrorCode* in/out)
r1, _, err := procucfpos_matchesField.Call(
uintptr(ucfpos),
uintptr(category),
uintptr(field),
uintptr(ec),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // CHARfunction ucfpos_matchesField(
ucfpos: Pointer; // UConstrainedFieldPosition*
category: Integer; // INT
field: Integer; // INT
ec: Pointer // UErrorCode* in/out
): Shortint; cdecl;
external 'icu.dll' name 'ucfpos_matchesField';result := DllCall("icu\ucfpos_matchesField"
, "Ptr", ucfpos ; UConstrainedFieldPosition*
, "Int", category ; INT
, "Int", field ; INT
, "Ptr", ec ; UErrorCode* in/out
, "Cdecl Char") ; return: CHAR●ucfpos_matchesField(ucfpos, category, field, ec) = DLL("icu.dll", "char ucfpos_matchesField(void*, int, int, void*)")
# 呼び出し: ucfpos_matchesField(ucfpos, category, field, ec)
# ucfpos : UConstrainedFieldPosition* -> "void*"
# category : INT -> "int"
# field : INT -> "int"
# ec : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。