ホーム › Globalization › uregex_appendReplacementUText
uregex_appendReplacementUText
関数一致箇所の置換結果をUText出力に追記する。
シグネチャ
// icuin.dll
#include <windows.h>
void uregex_appendReplacementUText(
URegularExpression* regexp,
UText* replacementText,
UText* dest,
UErrorCode* status
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| regexp | URegularExpression* | inout |
| replacementText | UText* | inout |
| dest | UText* | inout |
| status | UErrorCode* | inout |
戻り値の型: void
各言語での呼び出し定義
// icuin.dll
#include <windows.h>
void uregex_appendReplacementUText(
URegularExpression* regexp,
UText* replacementText,
UText* dest,
UErrorCode* status
);[DllImport("icuin.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void uregex_appendReplacementUText(
ref IntPtr regexp, // URegularExpression* in/out
IntPtr replacementText, // UText* in/out
IntPtr dest, // UText* in/out
ref int status // UErrorCode* in/out
);<DllImport("icuin.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub uregex_appendReplacementUText(
ByRef regexp As IntPtr, ' URegularExpression* in/out
replacementText As IntPtr, ' UText* in/out
dest As IntPtr, ' UText* in/out
ByRef status As Integer ' UErrorCode* in/out
)
End Sub' regexp : URegularExpression* in/out
' replacementText : UText* in/out
' dest : UText* in/out
' status : UErrorCode* in/out
Declare PtrSafe Sub uregex_appendReplacementUText Lib "icuin" ( _
ByRef regexp As LongPtr, _
ByVal replacementText As LongPtr, _
ByVal dest 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_appendReplacementUText = ctypes.cdll.icuin.uregex_appendReplacementUText
uregex_appendReplacementUText.restype = None
uregex_appendReplacementUText.argtypes = [
ctypes.c_void_p, # regexp : URegularExpression* in/out
ctypes.c_void_p, # replacementText : UText* in/out
ctypes.c_void_p, # dest : UText* in/out
ctypes.c_void_p, # status : UErrorCode* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuin.dll')
uregex_appendReplacementUText = Fiddle::Function.new(
lib['uregex_appendReplacementUText'],
[
Fiddle::TYPE_VOIDP, # regexp : URegularExpression* in/out
Fiddle::TYPE_VOIDP, # replacementText : UText* in/out
Fiddle::TYPE_VOIDP, # dest : UText* in/out
Fiddle::TYPE_VOIDP, # status : UErrorCode* in/out
],
Fiddle::TYPE_VOID, Fiddle::Function::CDECL)#[link(name = "icuin")]
extern "C" {
fn uregex_appendReplacementUText(
regexp: *mut isize, // URegularExpression* in/out
replacementText: *mut UText, // UText* in/out
dest: *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_appendReplacementUText(ref IntPtr regexp, IntPtr replacementText, IntPtr dest, ref int status);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_uregex_appendReplacementUText' -Namespace Win32 -PassThru
# $api::uregex_appendReplacementUText(regexp, replacementText, dest, status)#uselib "icuin.dll"
#func global uregex_appendReplacementUText "uregex_appendReplacementUText" sptr, sptr, sptr, sptr
; uregex_appendReplacementUText regexp, varptr(replacementText), varptr(dest), status
; regexp : URegularExpression* in/out -> "sptr"
; replacementText : UText* in/out -> "sptr"
; dest : UText* in/out -> "sptr"
; status : UErrorCode* in/out -> "sptr"出力引数:
#uselib "icuin.dll" #func global uregex_appendReplacementUText "uregex_appendReplacementUText" int, var, var, int ; uregex_appendReplacementUText regexp, replacementText, dest, status ; regexp : URegularExpression* in/out -> "int" ; replacementText : UText* in/out -> "var" ; dest : UText* in/out -> "var" ; status : UErrorCode* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icuin.dll" #func global uregex_appendReplacementUText "uregex_appendReplacementUText" int, sptr, sptr, int ; uregex_appendReplacementUText regexp, varptr(replacementText), varptr(dest), status ; regexp : URegularExpression* in/out -> "int" ; replacementText : UText* in/out -> "sptr" ; dest : UText* in/out -> "sptr" ; status : UErrorCode* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; void uregex_appendReplacementUText(URegularExpression* regexp, UText* replacementText, UText* dest, UErrorCode* status) #uselib "icuin.dll" #func global uregex_appendReplacementUText "uregex_appendReplacementUText" int, var, var, int ; uregex_appendReplacementUText regexp, replacementText, dest, status ; regexp : URegularExpression* in/out -> "int" ; replacementText : UText* in/out -> "var" ; dest : UText* in/out -> "var" ; status : UErrorCode* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; void uregex_appendReplacementUText(URegularExpression* regexp, UText* replacementText, UText* dest, UErrorCode* status) #uselib "icuin.dll" #func global uregex_appendReplacementUText "uregex_appendReplacementUText" int, intptr, intptr, int ; uregex_appendReplacementUText regexp, varptr(replacementText), varptr(dest), status ; regexp : URegularExpression* in/out -> "int" ; replacementText : UText* in/out -> "intptr" ; dest : UText* in/out -> "intptr" ; status : UErrorCode* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuin = windows.NewLazySystemDLL("icuin.dll")
procuregex_appendReplacementUText = icuin.NewProc("uregex_appendReplacementUText")
)
// regexp (URegularExpression* in/out), replacementText (UText* in/out), dest (UText* in/out), status (UErrorCode* in/out)
r1, _, err := procuregex_appendReplacementUText.Call(
uintptr(regexp),
uintptr(replacementText),
uintptr(dest),
uintptr(status),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure uregex_appendReplacementUText(
regexp: Pointer; // URegularExpression* in/out
replacementText: Pointer; // UText* in/out
dest: Pointer; // UText* in/out
status: Pointer // UErrorCode* in/out
); cdecl;
external 'icuin.dll' name 'uregex_appendReplacementUText';result := DllCall("icuin\uregex_appendReplacementUText"
, "Ptr", regexp ; URegularExpression* in/out
, "Ptr", replacementText ; UText* in/out
, "Ptr", dest ; UText* in/out
, "Ptr", status ; UErrorCode* in/out
, "Cdecl Int") ; return: void●uregex_appendReplacementUText(regexp, replacementText, dest, status) = DLL("icuin.dll", "int uregex_appendReplacementUText(void*, void*, void*, void*)")
# 呼び出し: uregex_appendReplacementUText(regexp, replacementText, dest, status)
# regexp : URegularExpression* in/out -> "void*"
# replacementText : UText* in/out -> "void*"
# dest : 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`,…) を使用。