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

ucfpos_getIndexes

関数
フィールド位置の開始と終了のインデックスを取得する。
DLLicu.dll呼出規約cdecl

シグネチャ

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

void ucfpos_getIndexes(
    const UConstrainedFieldPosition* ucfpos,
    INT* pStart,
    INT* pLimit,
    UErrorCode* ec
);

パラメーター

名前方向
ucfposUConstrainedFieldPosition*in
pStartINT*inout
pLimitINT*inout
ecUErrorCode*inout

戻り値の型: void

各言語での呼び出し定義

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

void ucfpos_getIndexes(
    const UConstrainedFieldPosition* ucfpos,
    INT* pStart,
    INT* pLimit,
    UErrorCode* ec
);
[DllImport("icu.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void ucfpos_getIndexes(
    ref IntPtr ucfpos,   // UConstrainedFieldPosition*
    ref int pStart,   // INT* in/out
    ref int pLimit,   // INT* in/out
    ref int ec   // UErrorCode* in/out
);
<DllImport("icu.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub ucfpos_getIndexes(
    ByRef ucfpos As IntPtr,   ' UConstrainedFieldPosition*
    ByRef pStart As Integer,   ' INT* in/out
    ByRef pLimit As Integer,   ' INT* in/out
    ByRef ec As Integer   ' UErrorCode* in/out
)
End Sub
' ucfpos : UConstrainedFieldPosition*
' pStart : INT* in/out
' pLimit : INT* in/out
' ec : UErrorCode* in/out
Declare PtrSafe Sub ucfpos_getIndexes Lib "icu" ( _
    ByRef ucfpos As LongPtr, _
    ByRef pStart As Long, _
    ByRef pLimit 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_getIndexes = ctypes.cdll.icu.ucfpos_getIndexes
ucfpos_getIndexes.restype = None
ucfpos_getIndexes.argtypes = [
    ctypes.c_void_p,  # ucfpos : UConstrainedFieldPosition*
    ctypes.POINTER(ctypes.c_int),  # pStart : INT* in/out
    ctypes.POINTER(ctypes.c_int),  # pLimit : INT* in/out
    ctypes.c_void_p,  # ec : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icu.dll')
ucfpos_getIndexes = Fiddle::Function.new(
  lib['ucfpos_getIndexes'],
  [
    Fiddle::TYPE_VOIDP,  # ucfpos : UConstrainedFieldPosition*
    Fiddle::TYPE_VOIDP,  # pStart : INT* in/out
    Fiddle::TYPE_VOIDP,  # pLimit : INT* in/out
    Fiddle::TYPE_VOIDP,  # ec : UErrorCode* in/out
  ],
  Fiddle::TYPE_VOID, Fiddle::Function::CDECL)
#[link(name = "icu")]
extern "C" {
    fn ucfpos_getIndexes(
        ucfpos: *const isize,  // UConstrainedFieldPosition*
        pStart: *mut i32,  // INT* in/out
        pLimit: *mut i32,  // INT* in/out
        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_getIndexes(ref IntPtr ucfpos, ref int pStart, ref int pLimit, ref int ec);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icu_ucfpos_getIndexes' -Namespace Win32 -PassThru
# $api::ucfpos_getIndexes(ucfpos, pStart, pLimit, ec)
#uselib "icu.dll"
#func global ucfpos_getIndexes "ucfpos_getIndexes" sptr, sptr, sptr, sptr
; ucfpos_getIndexes ucfpos, varptr(pStart), varptr(pLimit), ec
; ucfpos : UConstrainedFieldPosition* -> "sptr"
; pStart : INT* in/out -> "sptr"
; pLimit : INT* in/out -> "sptr"
; ec : UErrorCode* in/out -> "sptr"
出力引数:
#uselib "icu.dll"
#func global ucfpos_getIndexes "ucfpos_getIndexes" int, var, var, int
; ucfpos_getIndexes ucfpos, pStart, pLimit, ec
; ucfpos : UConstrainedFieldPosition* -> "int"
; pStart : INT* in/out -> "var"
; pLimit : INT* in/out -> "var"
; ec : UErrorCode* in/out -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; void ucfpos_getIndexes(UConstrainedFieldPosition* ucfpos, INT* pStart, INT* pLimit, UErrorCode* ec)
#uselib "icu.dll"
#func global ucfpos_getIndexes "ucfpos_getIndexes" int, var, var, int
; ucfpos_getIndexes ucfpos, pStart, pLimit, ec
; ucfpos : UConstrainedFieldPosition* -> "int"
; pStart : INT* in/out -> "var"
; pLimit : INT* in/out -> "var"
; ec : UErrorCode* in/out -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icu = windows.NewLazySystemDLL("icu.dll")
	procucfpos_getIndexes = icu.NewProc("ucfpos_getIndexes")
)

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