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

uregex_setUText

関数
正規表現の検索対象をUTextで設定する。
DLLicuin.dll呼出規約cdecl

シグネチャ

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

void uregex_setUText(
    URegularExpression* regexp,
    UText* text,
    UErrorCode* status
);

パラメーター

名前方向
regexpURegularExpression*inout
textUText*inout
statusUErrorCode*inout

戻り値の型: void

各言語での呼び出し定義

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

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

uregex_setUText = ctypes.cdll.icuin.uregex_setUText
uregex_setUText.restype = None
uregex_setUText.argtypes = [
    ctypes.c_void_p,  # regexp : URegularExpression* in/out
    ctypes.c_void_p,  # text : UText* in/out
    ctypes.c_void_p,  # status : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuin.dll')
uregex_setUText = Fiddle::Function.new(
  lib['uregex_setUText'],
  [
    Fiddle::TYPE_VOIDP,  # regexp : URegularExpression* in/out
    Fiddle::TYPE_VOIDP,  # text : UText* in/out
    Fiddle::TYPE_VOIDP,  # status : UErrorCode* in/out
  ],
  Fiddle::TYPE_VOID, Fiddle::Function::CDECL)
#[link(name = "icuin")]
extern "C" {
    fn uregex_setUText(
        regexp: *mut isize,  // URegularExpression* in/out
        text: *mut UText,  // UText* in/out
        status: *mut i32  // UErrorCode* in/out
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void uregex_setUText(ref IntPtr regexp, IntPtr text, ref int status);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_uregex_setUText' -Namespace Win32 -PassThru
# $api::uregex_setUText(regexp, text, status)
#uselib "icuin.dll"
#func global uregex_setUText "uregex_setUText" sptr, sptr, sptr
; uregex_setUText regexp, varptr(text), status
; regexp : URegularExpression* in/out -> "sptr"
; text : UText* in/out -> "sptr"
; status : UErrorCode* in/out -> "sptr"
出力引数:
#uselib "icuin.dll"
#func global uregex_setUText "uregex_setUText" int, var, int
; uregex_setUText regexp, text, status
; regexp : URegularExpression* in/out -> "int"
; text : UText* in/out -> "var"
; status : UErrorCode* in/out -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; void uregex_setUText(URegularExpression* regexp, UText* text, UErrorCode* status)
#uselib "icuin.dll"
#func global uregex_setUText "uregex_setUText" int, var, int
; uregex_setUText regexp, text, status
; regexp : URegularExpression* in/out -> "int"
; text : UText* in/out -> "var"
; status : UErrorCode* in/out -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procuregex_setUText = icuin.NewProc("uregex_setUText")
)

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