ホーム › Globalization › ucfpos_constrainCategory
ucfpos_constrainCategory
関数フィールド位置を指定カテゴリに制約する。
シグネチャ
// icu.dll
#include <windows.h>
void ucfpos_constrainCategory(
UConstrainedFieldPosition* ucfpos,
INT category,
UErrorCode* ec
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| ucfpos | UConstrainedFieldPosition* | inout | 制約を設定する制約付きフィールド位置オブジェクトのハンドル。 |
| category | INT | in | 反復対象を限定するフィールドカテゴリの値。 |
| ec | UErrorCode* | inout | エラーコードへのポインタ。呼び出し前に初期化する必要がある。 |
戻り値の型: void
各言語での呼び出し定義
// icu.dll
#include <windows.h>
void ucfpos_constrainCategory(
UConstrainedFieldPosition* ucfpos,
INT category,
UErrorCode* ec
);[DllImport("icu.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void ucfpos_constrainCategory(
ref IntPtr ucfpos, // UConstrainedFieldPosition* in/out
int category, // INT
ref int ec // UErrorCode* in/out
);<DllImport("icu.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub ucfpos_constrainCategory(
ByRef ucfpos As IntPtr, ' UConstrainedFieldPosition* in/out
category As Integer, ' INT
ByRef ec As Integer ' UErrorCode* in/out
)
End Sub' ucfpos : UConstrainedFieldPosition* in/out
' category : INT
' ec : UErrorCode* in/out
Declare PtrSafe Sub ucfpos_constrainCategory Lib "icu" ( _
ByRef ucfpos As LongPtr, _
ByVal category As Long, _
ByRef ec As Long)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ucfpos_constrainCategory = ctypes.cdll.icu.ucfpos_constrainCategory
ucfpos_constrainCategory.restype = None
ucfpos_constrainCategory.argtypes = [
ctypes.c_void_p, # ucfpos : UConstrainedFieldPosition* in/out
ctypes.c_int, # category : INT
ctypes.c_void_p, # ec : UErrorCode* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icu.dll')
ucfpos_constrainCategory = Fiddle::Function.new(
lib['ucfpos_constrainCategory'],
[
Fiddle::TYPE_VOIDP, # ucfpos : UConstrainedFieldPosition* in/out
Fiddle::TYPE_INT, # category : INT
Fiddle::TYPE_VOIDP, # ec : UErrorCode* in/out
],
Fiddle::TYPE_VOID, Fiddle::Function::CDECL)#[link(name = "icu")]
extern "C" {
fn ucfpos_constrainCategory(
ucfpos: *mut isize, // UConstrainedFieldPosition* in/out
category: i32, // INT
ec: *mut i32 // UErrorCode* in/out
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icu.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void ucfpos_constrainCategory(ref IntPtr ucfpos, int category, ref int ec);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icu_ucfpos_constrainCategory' -Namespace Win32 -PassThru
# $api::ucfpos_constrainCategory(ucfpos, category, ec)#uselib "icu.dll"
#func global ucfpos_constrainCategory "ucfpos_constrainCategory" sptr, sptr, sptr
; ucfpos_constrainCategory ucfpos, category, ec
; ucfpos : UConstrainedFieldPosition* in/out -> "sptr"
; category : INT -> "sptr"
; ec : UErrorCode* in/out -> "sptr"#uselib "icu.dll"
#func global ucfpos_constrainCategory "ucfpos_constrainCategory" int, int, int
; ucfpos_constrainCategory ucfpos, category, ec
; ucfpos : UConstrainedFieldPosition* in/out -> "int"
; category : INT -> "int"
; ec : UErrorCode* in/out -> "int"; void ucfpos_constrainCategory(UConstrainedFieldPosition* ucfpos, INT category, UErrorCode* ec)
#uselib "icu.dll"
#func global ucfpos_constrainCategory "ucfpos_constrainCategory" int, int, int
; ucfpos_constrainCategory ucfpos, category, ec
; ucfpos : UConstrainedFieldPosition* in/out -> "int"
; category : INT -> "int"
; ec : UErrorCode* in/out -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icu = windows.NewLazySystemDLL("icu.dll")
procucfpos_constrainCategory = icu.NewProc("ucfpos_constrainCategory")
)
// ucfpos (UConstrainedFieldPosition* in/out), category (INT), ec (UErrorCode* in/out)
r1, _, err := procucfpos_constrainCategory.Call(
uintptr(ucfpos),
uintptr(category),
uintptr(ec),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure ucfpos_constrainCategory(
ucfpos: Pointer; // UConstrainedFieldPosition* in/out
category: Integer; // INT
ec: Pointer // UErrorCode* in/out
); cdecl;
external 'icu.dll' name 'ucfpos_constrainCategory';result := DllCall("icu\ucfpos_constrainCategory"
, "Ptr", ucfpos ; UConstrainedFieldPosition* in/out
, "Int", category ; INT
, "Ptr", ec ; UErrorCode* in/out
, "Cdecl Int") ; return: void●ucfpos_constrainCategory(ucfpos, category, ec) = DLL("icu.dll", "int ucfpos_constrainCategory(void*, int, void*)")
# 呼び出し: ucfpos_constrainCategory(ucfpos, category, ec)
# ucfpos : UConstrainedFieldPosition* in/out -> "void*"
# category : INT -> "int"
# ec : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。