ホーム › Globalization › uset_retainAllCodePoints
uset_retainAllCodePoints
関数文字列中のコードポイントのみをUSetに残す。
シグネチャ
// icu.dll
#include <windows.h>
void uset_retainAllCodePoints(
USet* set,
const WORD* str,
INT length
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| set | USet* | inout |
| str | WORD* | in |
| length | INT | in |
戻り値の型: void
各言語での呼び出し定義
// icu.dll
#include <windows.h>
void uset_retainAllCodePoints(
USet* set,
const WORD* str,
INT length
);[DllImport("icu.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void uset_retainAllCodePoints(
ref IntPtr set, // USet* in/out
ref ushort str, // WORD*
int length // INT
);<DllImport("icu.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub uset_retainAllCodePoints(
ByRef [set] As IntPtr, ' USet* in/out
ByRef str As UShort, ' WORD*
length As Integer ' INT
)
End Sub' set : USet* in/out
' str : WORD*
' length : INT
Declare PtrSafe Sub uset_retainAllCodePoints Lib "icu" ( _
ByRef set As LongPtr, _
ByRef str As Integer, _
ByVal length As Long)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
uset_retainAllCodePoints = ctypes.cdll.icu.uset_retainAllCodePoints
uset_retainAllCodePoints.restype = None
uset_retainAllCodePoints.argtypes = [
ctypes.c_void_p, # set : USet* in/out
ctypes.POINTER(ctypes.c_ushort), # str : WORD*
ctypes.c_int, # length : INT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icu.dll')
uset_retainAllCodePoints = Fiddle::Function.new(
lib['uset_retainAllCodePoints'],
[
Fiddle::TYPE_VOIDP, # set : USet* in/out
Fiddle::TYPE_VOIDP, # str : WORD*
Fiddle::TYPE_INT, # length : INT
],
Fiddle::TYPE_VOID, Fiddle::Function::CDECL)#[link(name = "icu")]
extern "C" {
fn uset_retainAllCodePoints(
set: *mut isize, // USet* in/out
str: *const u16, // WORD*
length: i32 // INT
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icu.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void uset_retainAllCodePoints(ref IntPtr set, ref ushort str, int length);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icu_uset_retainAllCodePoints' -Namespace Win32 -PassThru
# $api::uset_retainAllCodePoints(set, str, length)#uselib "icu.dll"
#func global uset_retainAllCodePoints "uset_retainAllCodePoints" sptr, sptr, sptr
; uset_retainAllCodePoints set, varptr(str), length
; set : USet* in/out -> "sptr"
; str : WORD* -> "sptr"
; length : INT -> "sptr"出力引数:
#uselib "icu.dll" #func global uset_retainAllCodePoints "uset_retainAllCodePoints" int, var, int ; uset_retainAllCodePoints set, str, length ; set : USet* in/out -> "int" ; str : WORD* -> "var" ; length : INT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icu.dll" #func global uset_retainAllCodePoints "uset_retainAllCodePoints" int, sptr, int ; uset_retainAllCodePoints set, varptr(str), length ; set : USet* in/out -> "int" ; str : WORD* -> "sptr" ; length : INT -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; void uset_retainAllCodePoints(USet* set, WORD* str, INT length) #uselib "icu.dll" #func global uset_retainAllCodePoints "uset_retainAllCodePoints" int, var, int ; uset_retainAllCodePoints set, str, length ; set : USet* in/out -> "int" ; str : WORD* -> "var" ; length : INT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; void uset_retainAllCodePoints(USet* set, WORD* str, INT length) #uselib "icu.dll" #func global uset_retainAllCodePoints "uset_retainAllCodePoints" int, intptr, int ; uset_retainAllCodePoints set, varptr(str), length ; set : USet* in/out -> "int" ; str : WORD* -> "intptr" ; length : INT -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icu = windows.NewLazySystemDLL("icu.dll")
procuset_retainAllCodePoints = icu.NewProc("uset_retainAllCodePoints")
)
// set (USet* in/out), str (WORD*), length (INT)
r1, _, err := procuset_retainAllCodePoints.Call(
uintptr(set),
uintptr(str),
uintptr(length),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure uset_retainAllCodePoints(
set: Pointer; // USet* in/out
str: Pointer; // WORD*
length: Integer // INT
); cdecl;
external 'icu.dll' name 'uset_retainAllCodePoints';result := DllCall("icu\uset_retainAllCodePoints"
, "Ptr", set ; USet* in/out
, "Ptr", str ; WORD*
, "Int", length ; INT
, "Cdecl Int") ; return: void●uset_retainAllCodePoints(set, str, length) = DLL("icu.dll", "int uset_retainAllCodePoints(void*, void*, int)")
# 呼び出し: uset_retainAllCodePoints(set, str, length)
# set : USet* in/out -> "void*"
# str : WORD* -> "void*"
# length : INT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。