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