ホーム › Globalization › uregex_getUText
uregex_getUText
関数正規表現の検索対象をUTextとして取得する。
シグネチャ
// icuin.dll
#include <windows.h>
UText* uregex_getUText(
URegularExpression* regexp,
UText* dest,
UErrorCode* status
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| regexp | URegularExpression* | inout |
| dest | UText* | inout |
| status | UErrorCode* | inout |
戻り値の型: UText*
各言語での呼び出し定義
// icuin.dll
#include <windows.h>
UText* uregex_getUText(
URegularExpression* regexp,
UText* dest,
UErrorCode* status
);[DllImport("icuin.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr uregex_getUText(
ref IntPtr regexp, // URegularExpression* in/out
IntPtr dest, // UText* in/out
ref int status // UErrorCode* in/out
);<DllImport("icuin.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function uregex_getUText(
ByRef regexp As IntPtr, ' URegularExpression* in/out
dest As IntPtr, ' UText* in/out
ByRef status As Integer ' UErrorCode* in/out
) As IntPtr
End Function' regexp : URegularExpression* in/out
' dest : UText* in/out
' status : UErrorCode* in/out
Declare PtrSafe Function uregex_getUText Lib "icuin" ( _
ByRef regexp As LongPtr, _
ByVal dest As LongPtr, _
ByRef status As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
uregex_getUText = ctypes.cdll.icuin.uregex_getUText
uregex_getUText.restype = ctypes.c_void_p
uregex_getUText.argtypes = [
ctypes.c_void_p, # regexp : URegularExpression* 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_getUText = Fiddle::Function.new(
lib['uregex_getUText'],
[
Fiddle::TYPE_VOIDP, # regexp : URegularExpression* in/out
Fiddle::TYPE_VOIDP, # dest : UText* in/out
Fiddle::TYPE_VOIDP, # status : UErrorCode* in/out
],
Fiddle::TYPE_VOIDP, Fiddle::Function::CDECL)#[link(name = "icuin")]
extern "C" {
fn uregex_getUText(
regexp: *mut isize, // URegularExpression* in/out
dest: *mut UText, // UText* in/out
status: *mut i32 // UErrorCode* in/out
) -> *mut UText;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr uregex_getUText(ref IntPtr regexp, IntPtr dest, ref int status);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_uregex_getUText' -Namespace Win32 -PassThru
# $api::uregex_getUText(regexp, dest, status)#uselib "icuin.dll"
#func global uregex_getUText "uregex_getUText" sptr, sptr, sptr
; uregex_getUText regexp, varptr(dest), status ; 戻り値は stat
; regexp : URegularExpression* in/out -> "sptr"
; dest : UText* in/out -> "sptr"
; status : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "icuin.dll" #cfunc global uregex_getUText "uregex_getUText" int, var, int ; res = uregex_getUText(regexp, dest, status) ; regexp : URegularExpression* in/out -> "int" ; dest : UText* in/out -> "var" ; status : UErrorCode* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icuin.dll" #cfunc global uregex_getUText "uregex_getUText" int, sptr, int ; res = uregex_getUText(regexp, varptr(dest), status) ; regexp : URegularExpression* in/out -> "int" ; dest : UText* in/out -> "sptr" ; status : UErrorCode* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; UText* uregex_getUText(URegularExpression* regexp, UText* dest, UErrorCode* status) #uselib "icuin.dll" #cfunc global uregex_getUText "uregex_getUText" int, var, int ; res = uregex_getUText(regexp, dest, status) ; regexp : URegularExpression* in/out -> "int" ; dest : UText* in/out -> "var" ; status : UErrorCode* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; UText* uregex_getUText(URegularExpression* regexp, UText* dest, UErrorCode* status) #uselib "icuin.dll" #cfunc global uregex_getUText "uregex_getUText" int, intptr, int ; res = uregex_getUText(regexp, varptr(dest), status) ; regexp : URegularExpression* in/out -> "int" ; 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_getUText = icuin.NewProc("uregex_getUText")
)
// regexp (URegularExpression* in/out), dest (UText* in/out), status (UErrorCode* in/out)
r1, _, err := procuregex_getUText.Call(
uintptr(regexp),
uintptr(dest),
uintptr(status),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // UText*function uregex_getUText(
regexp: Pointer; // URegularExpression* in/out
dest: Pointer; // UText* in/out
status: Pointer // UErrorCode* in/out
): Pointer; cdecl;
external 'icuin.dll' name 'uregex_getUText';result := DllCall("icuin\uregex_getUText"
, "Ptr", regexp ; URegularExpression* in/out
, "Ptr", dest ; UText* in/out
, "Ptr", status ; UErrorCode* in/out
, "Cdecl Ptr") ; return: UText*●uregex_getUText(regexp, dest, status) = DLL("icuin.dll", "void* uregex_getUText(void*, void*, void*)")
# 呼び出し: uregex_getUText(regexp, dest, status)
# regexp : URegularExpression* 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`,…) を使用。