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

usearch_following

関数
指定位置以降で最初の一致位置を検索する。
DLLicuin.dll呼出規約cdecl

シグネチャ

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

INT usearch_following(
    UStringSearch* strsrch,
    INT position,
    UErrorCode* status
);

パラメーター

名前方向
strsrchUStringSearch*inout
positionINTin
statusUErrorCode*inout

戻り値の型: INT

各言語での呼び出し定義

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

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

usearch_following = ctypes.cdll.icuin.usearch_following
usearch_following.restype = ctypes.c_int
usearch_following.argtypes = [
    ctypes.c_void_p,  # strsrch : UStringSearch* in/out
    ctypes.c_int,  # position : INT
    ctypes.c_void_p,  # status : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procusearch_following = icuin.NewProc("usearch_following")
)

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