ホーム › Globalization › ucfpos_setState
ucfpos_setState
関数制約付きフィールド位置の状態を一括設定する。
シグネチャ
// icu.dll
#include <windows.h>
void ucfpos_setState(
UConstrainedFieldPosition* ucfpos,
INT category,
INT field,
INT start,
INT limit,
UErrorCode* ec
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| ucfpos | UConstrainedFieldPosition* | inout |
| category | INT | in |
| field | INT | in |
| start | INT | in |
| limit | INT | in |
| ec | UErrorCode* | inout |
戻り値の型: void
各言語での呼び出し定義
// icu.dll
#include <windows.h>
void ucfpos_setState(
UConstrainedFieldPosition* ucfpos,
INT category,
INT field,
INT start,
INT limit,
UErrorCode* ec
);[DllImport("icu.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void ucfpos_setState(
ref IntPtr ucfpos, // UConstrainedFieldPosition* in/out
int category, // INT
int field, // INT
int start, // INT
int limit, // INT
ref int ec // UErrorCode* in/out
);<DllImport("icu.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub ucfpos_setState(
ByRef ucfpos As IntPtr, ' UConstrainedFieldPosition* in/out
category As Integer, ' INT
field As Integer, ' INT
start As Integer, ' INT
limit As Integer, ' INT
ByRef ec As Integer ' UErrorCode* in/out
)
End Sub' ucfpos : UConstrainedFieldPosition* in/out
' category : INT
' field : INT
' start : INT
' limit : INT
' ec : UErrorCode* in/out
Declare PtrSafe Sub ucfpos_setState Lib "icu" ( _
ByRef ucfpos As LongPtr, _
ByVal category As Long, _
ByVal field As Long, _
ByVal start As Long, _
ByVal limit 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_setState = ctypes.cdll.icu.ucfpos_setState
ucfpos_setState.restype = None
ucfpos_setState.argtypes = [
ctypes.c_void_p, # ucfpos : UConstrainedFieldPosition* in/out
ctypes.c_int, # category : INT
ctypes.c_int, # field : INT
ctypes.c_int, # start : INT
ctypes.c_int, # limit : INT
ctypes.c_void_p, # ec : UErrorCode* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icu.dll')
ucfpos_setState = Fiddle::Function.new(
lib['ucfpos_setState'],
[
Fiddle::TYPE_VOIDP, # ucfpos : UConstrainedFieldPosition* in/out
Fiddle::TYPE_INT, # category : INT
Fiddle::TYPE_INT, # field : INT
Fiddle::TYPE_INT, # start : INT
Fiddle::TYPE_INT, # limit : INT
Fiddle::TYPE_VOIDP, # ec : UErrorCode* in/out
],
Fiddle::TYPE_VOID, Fiddle::Function::CDECL)#[link(name = "icu")]
extern "C" {
fn ucfpos_setState(
ucfpos: *mut isize, // UConstrainedFieldPosition* in/out
category: i32, // INT
field: i32, // INT
start: i32, // INT
limit: 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_setState(ref IntPtr ucfpos, int category, int field, int start, int limit, ref int ec);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icu_ucfpos_setState' -Namespace Win32 -PassThru
# $api::ucfpos_setState(ucfpos, category, field, start, limit, ec)#uselib "icu.dll"
#func global ucfpos_setState "ucfpos_setState" sptr, sptr, sptr, sptr, sptr, sptr
; ucfpos_setState ucfpos, category, field, start, limit, ec
; ucfpos : UConstrainedFieldPosition* in/out -> "sptr"
; category : INT -> "sptr"
; field : INT -> "sptr"
; start : INT -> "sptr"
; limit : INT -> "sptr"
; ec : UErrorCode* in/out -> "sptr"#uselib "icu.dll"
#func global ucfpos_setState "ucfpos_setState" int, int, int, int, int, int
; ucfpos_setState ucfpos, category, field, start, limit, ec
; ucfpos : UConstrainedFieldPosition* in/out -> "int"
; category : INT -> "int"
; field : INT -> "int"
; start : INT -> "int"
; limit : INT -> "int"
; ec : UErrorCode* in/out -> "int"; void ucfpos_setState(UConstrainedFieldPosition* ucfpos, INT category, INT field, INT start, INT limit, UErrorCode* ec)
#uselib "icu.dll"
#func global ucfpos_setState "ucfpos_setState" int, int, int, int, int, int
; ucfpos_setState ucfpos, category, field, start, limit, ec
; ucfpos : UConstrainedFieldPosition* in/out -> "int"
; category : INT -> "int"
; field : INT -> "int"
; start : INT -> "int"
; limit : INT -> "int"
; ec : UErrorCode* in/out -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icu = windows.NewLazySystemDLL("icu.dll")
procucfpos_setState = icu.NewProc("ucfpos_setState")
)
// ucfpos (UConstrainedFieldPosition* in/out), category (INT), field (INT), start (INT), limit (INT), ec (UErrorCode* in/out)
r1, _, err := procucfpos_setState.Call(
uintptr(ucfpos),
uintptr(category),
uintptr(field),
uintptr(start),
uintptr(limit),
uintptr(ec),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure ucfpos_setState(
ucfpos: Pointer; // UConstrainedFieldPosition* in/out
category: Integer; // INT
field: Integer; // INT
start: Integer; // INT
limit: Integer; // INT
ec: Pointer // UErrorCode* in/out
); cdecl;
external 'icu.dll' name 'ucfpos_setState';result := DllCall("icu\ucfpos_setState"
, "Ptr", ucfpos ; UConstrainedFieldPosition* in/out
, "Int", category ; INT
, "Int", field ; INT
, "Int", start ; INT
, "Int", limit ; INT
, "Ptr", ec ; UErrorCode* in/out
, "Cdecl Int") ; return: void●ucfpos_setState(ucfpos, category, field, start, limit, ec) = DLL("icu.dll", "int ucfpos_setState(void*, int, int, int, int, void*)")
# 呼び出し: ucfpos_setState(ucfpos, category, field, start, limit, ec)
# ucfpos : UConstrainedFieldPosition* in/out -> "void*"
# category : INT -> "int"
# field : INT -> "int"
# start : INT -> "int"
# limit : INT -> "int"
# ec : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。