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

uregex_lookingAt

関数
指定位置からパターンに前方一致するか判定する。
DLLicuin.dll呼出規約cdecl

シグネチャ

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

CHAR uregex_lookingAt(
    URegularExpression* regexp,
    INT startIndex,
    UErrorCode* status
);

パラメーター

名前方向
regexpURegularExpression*inout
startIndexINTin
statusUErrorCode*inout

戻り値の型: CHAR

各言語での呼び出し定義

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

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

uregex_lookingAt = ctypes.cdll.icuin.uregex_lookingAt
uregex_lookingAt.restype = ctypes.c_byte
uregex_lookingAt.argtypes = [
    ctypes.c_void_p,  # regexp : URegularExpression* in/out
    ctypes.c_int,  # startIndex : INT
    ctypes.c_void_p,  # status : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procuregex_lookingAt = icuin.NewProc("uregex_lookingAt")
)

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