Win32 API 日本語リファレンス
ホームGlobalization › ucfpos_getCategory

ucfpos_getCategory

関数
制約付きフィールド位置のカテゴリを取得する。
DLLicu.dll呼出規約cdecl

シグネチャ

// icu.dll
#include <windows.h>

INT ucfpos_getCategory(
    const UConstrainedFieldPosition* ucfpos,
    UErrorCode* ec
);

パラメーター

名前方向
ucfposUConstrainedFieldPosition*in
ecUErrorCode*inout

戻り値の型: INT

各言語での呼び出し定義

// icu.dll
#include <windows.h>

INT ucfpos_getCategory(
    const UConstrainedFieldPosition* ucfpos,
    UErrorCode* ec
);
[DllImport("icu.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern int ucfpos_getCategory(
    ref IntPtr ucfpos,   // UConstrainedFieldPosition*
    ref int ec   // UErrorCode* in/out
);
<DllImport("icu.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ucfpos_getCategory(
    ByRef ucfpos As IntPtr,   ' UConstrainedFieldPosition*
    ByRef ec As Integer   ' UErrorCode* in/out
) As Integer
End Function
' ucfpos : UConstrainedFieldPosition*
' ec : UErrorCode* in/out
Declare PtrSafe Function ucfpos_getCategory Lib "icu" ( _
    ByRef ucfpos As LongPtr, _
    ByRef ec As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ucfpos_getCategory = ctypes.cdll.icu.ucfpos_getCategory
ucfpos_getCategory.restype = ctypes.c_int
ucfpos_getCategory.argtypes = [
    ctypes.c_void_p,  # ucfpos : UConstrainedFieldPosition*
    ctypes.c_void_p,  # ec : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icu.dll')
ucfpos_getCategory = Fiddle::Function.new(
  lib['ucfpos_getCategory'],
  [
    Fiddle::TYPE_VOIDP,  # ucfpos : UConstrainedFieldPosition*
    Fiddle::TYPE_VOIDP,  # ec : UErrorCode* in/out
  ],
  Fiddle::TYPE_INT, Fiddle::Function::CDECL)
#[link(name = "icu")]
extern "C" {
    fn ucfpos_getCategory(
        ucfpos: *const isize,  // UConstrainedFieldPosition*
        ec: *mut i32  // UErrorCode* in/out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icu.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int ucfpos_getCategory(ref IntPtr ucfpos, ref int ec);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icu_ucfpos_getCategory' -Namespace Win32 -PassThru
# $api::ucfpos_getCategory(ucfpos, ec)
#uselib "icu.dll"
#func global ucfpos_getCategory "ucfpos_getCategory" sptr, sptr
; ucfpos_getCategory ucfpos, ec   ; 戻り値は stat
; ucfpos : UConstrainedFieldPosition* -> "sptr"
; ec : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "icu.dll"
#cfunc global ucfpos_getCategory "ucfpos_getCategory" int, int
; res = ucfpos_getCategory(ucfpos, ec)
; ucfpos : UConstrainedFieldPosition* -> "int"
; ec : UErrorCode* in/out -> "int"
; INT ucfpos_getCategory(UConstrainedFieldPosition* ucfpos, UErrorCode* ec)
#uselib "icu.dll"
#cfunc global ucfpos_getCategory "ucfpos_getCategory" int, int
; res = ucfpos_getCategory(ucfpos, ec)
; ucfpos : UConstrainedFieldPosition* -> "int"
; ec : UErrorCode* in/out -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icu = windows.NewLazySystemDLL("icu.dll")
	procucfpos_getCategory = icu.NewProc("ucfpos_getCategory")
)

// ucfpos (UConstrainedFieldPosition*), ec (UErrorCode* in/out)
r1, _, err := procucfpos_getCategory.Call(
	uintptr(ucfpos),
	uintptr(ec),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function ucfpos_getCategory(
  ucfpos: Pointer;   // UConstrainedFieldPosition*
  ec: Pointer   // UErrorCode* in/out
): Integer; cdecl;
  external 'icu.dll' name 'ucfpos_getCategory';
result := DllCall("icu\ucfpos_getCategory"
    , "Ptr", ucfpos   ; UConstrainedFieldPosition*
    , "Ptr", ec   ; UErrorCode* in/out
    , "Cdecl Int")   ; return: INT
●ucfpos_getCategory(ucfpos, ec) = DLL("icu.dll", "int ucfpos_getCategory(void*, void*)")
# 呼び出し: ucfpos_getCategory(ucfpos, ec)
# ucfpos : UConstrainedFieldPosition* -> "void*"
# ec : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。