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

usearch_getMatchedStart

関数
一致した部分文字列の開始位置を取得する。
DLLicuin.dll呼出規約cdecl

シグネチャ

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

INT usearch_getMatchedStart(
    const UStringSearch* strsrch
);

パラメーター

名前方向
strsrchUStringSearch*in

戻り値の型: INT

各言語での呼び出し定義

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

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

usearch_getMatchedStart = ctypes.cdll.icuin.usearch_getMatchedStart
usearch_getMatchedStart.restype = ctypes.c_int
usearch_getMatchedStart.argtypes = [
    ctypes.c_void_p,  # strsrch : UStringSearch*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procusearch_getMatchedStart = icuin.NewProc("usearch_getMatchedStart")
)

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