ホーム › Globalization › uset_removeString
uset_removeString
関数指定した文字列をUSetから削除する。
シグネチャ
// icuuc.dll
#include <windows.h>
void uset_removeString(
USet* set,
const WORD* str,
INT strLen
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| set | USet* | inout | 対象のUnicodeセット。 |
| str | WORD* | in | セットから除去する文字列(複数文字シーケンス)へのポインタ。 |
| strLen | INT | in | strの長さ(UChar単位)。-1の場合はNUL終端文字列として扱う。 |
戻り値の型: void
各言語での呼び出し定義
// icuuc.dll
#include <windows.h>
void uset_removeString(
USet* set,
const WORD* str,
INT strLen
);[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void uset_removeString(
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_removeString(
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_removeString 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_removeString = ctypes.cdll.icuuc.uset_removeString
uset_removeString.restype = None
uset_removeString.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_removeString = Fiddle::Function.new(
lib['uset_removeString'],
[
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_removeString(
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_removeString(ref IntPtr set, ref ushort str, int strLen);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_uset_removeString' -Namespace Win32 -PassThru
# $api::uset_removeString(set, str, strLen)#uselib "icuuc.dll"
#func global uset_removeString "uset_removeString" sptr, sptr, sptr
; uset_removeString varptr(set), varptr(str), strLen
; set : USet* in/out -> "sptr"
; str : WORD* -> "sptr"
; strLen : INT -> "sptr"出力引数:
#uselib "icuuc.dll" #func global uset_removeString "uset_removeString" var, var, int ; uset_removeString set, str, strLen ; set : USet* in/out -> "var" ; str : WORD* -> "var" ; strLen : INT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icuuc.dll" #func global uset_removeString "uset_removeString" sptr, sptr, int ; uset_removeString varptr(set), varptr(str), strLen ; set : USet* in/out -> "sptr" ; str : WORD* -> "sptr" ; strLen : INT -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; void uset_removeString(USet* set, WORD* str, INT strLen) #uselib "icuuc.dll" #func global uset_removeString "uset_removeString" var, var, int ; uset_removeString set, str, strLen ; set : USet* in/out -> "var" ; str : WORD* -> "var" ; strLen : INT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; void uset_removeString(USet* set, WORD* str, INT strLen) #uselib "icuuc.dll" #func global uset_removeString "uset_removeString" intptr, intptr, int ; uset_removeString varptr(set), varptr(str), strLen ; set : USet* in/out -> "intptr" ; str : WORD* -> "intptr" ; strLen : INT -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuuc = windows.NewLazySystemDLL("icuuc.dll")
procuset_removeString = icuuc.NewProc("uset_removeString")
)
// set (USet* in/out), str (WORD*), strLen (INT)
r1, _, err := procuset_removeString.Call(
uintptr(set),
uintptr(str),
uintptr(strLen),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure uset_removeString(
set: Pointer; // USet* in/out
str: Pointer; // WORD*
strLen: Integer // INT
); cdecl;
external 'icuuc.dll' name 'uset_removeString';result := DllCall("icuuc\uset_removeString"
, "Ptr", set ; USet* in/out
, "Ptr", str ; WORD*
, "Int", strLen ; INT
, "Cdecl Int") ; return: void●uset_removeString(set, str, strLen) = DLL("icuuc.dll", "int uset_removeString(void*, void*, int)")
# 呼び出し: uset_removeString(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`,…) を使用。const std = @import("std");
extern "icuuc" fn uset_removeString(
set: [*c]isize, // USet* in/out
str: [*c]u16, // WORD*
strLen: i32 // INT
) callconv(.c) void;proc uset_removeString(
set: ptr int, # USet* in/out
str: ptr uint16, # WORD*
strLen: int32 # INT
) {.importc: "uset_removeString", cdecl, dynlib: "icuuc.dll".}pragma(lib, "icuuc");
extern(C)
void uset_removeString(
ptrdiff_t* set, // USet* in/out
ushort* str, // WORD*
int strLen // INT
);ccall((:uset_removeString, "icuuc.dll"), Cvoid,
(Ptr{Int}, Ptr{UInt16}, Int32),
set, str, strLen)
# set : USet* in/out -> Ptr{Int}
# str : WORD* -> Ptr{UInt16}
# strLen : INT -> Int32local ffi = require("ffi")
ffi.cdef[[
void uset_removeString(
intptr_t* set,
uint16_t* str,
int32_t strLen);
]]
local icuuc = ffi.load("icuuc")
-- icuuc.uset_removeString(set, str, strLen)
-- set : USet* in/out
-- str : WORD*
-- strLen : INT
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('icuuc.dll');
const uset_removeString = lib.func('__cdecl', 'uset_removeString', 'void', ['intptr_t *', 'uint16_t *', 'int32_t']);
// uset_removeString(set, str, strLen)
// set : USet* in/out -> 'intptr_t *'
// str : WORD* -> 'uint16_t *'
// strLen : INT -> 'int32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("icuuc.dll", {
uset_removeString: { parameters: ["pointer", "pointer", "i32"], result: "void" },
});
// lib.symbols.uset_removeString(set, str, strLen)
// set : USet* in/out -> "pointer"
// str : WORD* -> "pointer"
// strLen : INT -> "i32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
void uset_removeString(
intptr_t* set,
uint16_t* str,
int32_t strLen);
C, "icuuc.dll");
// $ffi->uset_removeString(set, str, strLen);
// set : USet* in/out
// str : WORD*
// strLen : INT
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Icuuc extends Library {
Icuuc INSTANCE = Native.load("icuuc", Icuuc.class);
void uset_removeString(
LongByReference set, // USet* in/out
ShortByReference str, // WORD*
int strLen // INT
);
}@[Link("icuuc")]
lib Libicuuc
fun uset_removeString = uset_removeString(
set : LibC::SSizeT*, # USet* in/out
str : UInt16*, # WORD*
strLen : Int32 # INT
) : Void
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef uset_removeStringNative = Void Function(Pointer<IntPtr>, Pointer<Uint16>, Int32);
typedef uset_removeStringDart = void Function(Pointer<IntPtr>, Pointer<Uint16>, int);
final uset_removeString = DynamicLibrary.open('icuuc.dll')
.lookupFunction<uset_removeStringNative, uset_removeStringDart>('uset_removeString');
// set : USet* in/out -> Pointer<IntPtr>
// str : WORD* -> Pointer<Uint16>
// strLen : INT -> Int32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
procedure uset_removeString(
set: Pointer; // USet* in/out
str: Pointer; // WORD*
strLen: Integer // INT
); cdecl;
external 'icuuc.dll' name 'uset_removeString';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import ccall safe "uset_removeString"
c_uset_removeString :: Ptr CIntPtr -> Ptr Word16 -> Int32 -> IO ()
-- set : USet* in/out -> Ptr CIntPtr
-- str : WORD* -> Ptr Word16
-- strLen : INT -> Int32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let uset_removestring =
foreign "uset_removeString"
((ptr intptr_t) @-> (ptr uint16_t) @-> int32_t @-> returning void)
(* set : USet* in/out -> (ptr intptr_t) *)
(* str : WORD* -> (ptr uint16_t) *)
(* strLen : INT -> int32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library icuuc (t "icuuc.dll"))
(cffi:use-foreign-library icuuc)
(cffi:defcfun ("uset_removeString" uset-remove-string :convention :cdecl) :void
(set :pointer) ; USet* in/out
(str :pointer) ; WORD*
(str-len :int32)) ; INT
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $uset_removeString = Win32::API::More->new('icuuc',
'void uset_removeString(LPVOID set, LPVOID str, int strLen)');
# my $ret = $uset_removeString->Call($set, $str, $strLen);
# set : USet* in/out -> LPVOID
# str : WORD* -> LPVOID
# strLen : INT -> int
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。