ホーム › Globalization › uset_removeAllStrings
uset_removeAllStrings
関数USetから文字列要素をすべて削除する。
シグネチャ
// icuuc.dll
#include <windows.h>
void uset_removeAllStrings(
USet* set
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| set | USet* | inout | 対象のUnicodeセット。複数文字シーケンス(文字列要素)のみ除去し単一コードポイントは残す。 |
戻り値の型: void
各言語での呼び出し定義
// icuuc.dll
#include <windows.h>
void uset_removeAllStrings(
USet* set
);[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void uset_removeAllStrings(
ref IntPtr set // USet* in/out
);<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub uset_removeAllStrings(
ByRef [set] As IntPtr ' USet* in/out
)
End Sub' set : USet* in/out
Declare PtrSafe Sub uset_removeAllStrings Lib "icuuc" ( _
ByRef set As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
uset_removeAllStrings = ctypes.cdll.icuuc.uset_removeAllStrings
uset_removeAllStrings.restype = None
uset_removeAllStrings.argtypes = [
ctypes.c_void_p, # set : USet* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuuc.dll')
uset_removeAllStrings = Fiddle::Function.new(
lib['uset_removeAllStrings'],
[
Fiddle::TYPE_VOIDP, # set : USet* in/out
],
Fiddle::TYPE_VOID, Fiddle::Function::CDECL)#[link(name = "icuuc")]
extern "C" {
fn uset_removeAllStrings(
set: *mut isize // USet* in/out
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void uset_removeAllStrings(ref IntPtr set);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_uset_removeAllStrings' -Namespace Win32 -PassThru
# $api::uset_removeAllStrings(set)#uselib "icuuc.dll"
#func global uset_removeAllStrings "uset_removeAllStrings" sptr
; uset_removeAllStrings varptr(set)
; set : USet* in/out -> "sptr"出力引数:
#uselib "icuuc.dll" #func global uset_removeAllStrings "uset_removeAllStrings" var ; uset_removeAllStrings set ; set : USet* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icuuc.dll" #func global uset_removeAllStrings "uset_removeAllStrings" sptr ; uset_removeAllStrings varptr(set) ; set : USet* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; void uset_removeAllStrings(USet* set) #uselib "icuuc.dll" #func global uset_removeAllStrings "uset_removeAllStrings" var ; uset_removeAllStrings set ; set : USet* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; void uset_removeAllStrings(USet* set) #uselib "icuuc.dll" #func global uset_removeAllStrings "uset_removeAllStrings" intptr ; uset_removeAllStrings varptr(set) ; set : USet* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuuc = windows.NewLazySystemDLL("icuuc.dll")
procuset_removeAllStrings = icuuc.NewProc("uset_removeAllStrings")
)
// set (USet* in/out)
r1, _, err := procuset_removeAllStrings.Call(
uintptr(set),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure uset_removeAllStrings(
set: Pointer // USet* in/out
); cdecl;
external 'icuuc.dll' name 'uset_removeAllStrings';result := DllCall("icuuc\uset_removeAllStrings"
, "Ptr", set ; USet* in/out
, "Cdecl Int") ; return: void●uset_removeAllStrings(set) = DLL("icuuc.dll", "int uset_removeAllStrings(void*)")
# 呼び出し: uset_removeAllStrings(set)
# set : USet* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。const std = @import("std");
extern "icuuc" fn uset_removeAllStrings(
set: [*c]isize // USet* in/out
) callconv(.c) void;proc uset_removeAllStrings(
set: ptr int # USet* in/out
) {.importc: "uset_removeAllStrings", cdecl, dynlib: "icuuc.dll".}pragma(lib, "icuuc");
extern(C)
void uset_removeAllStrings(
ptrdiff_t* set // USet* in/out
);ccall((:uset_removeAllStrings, "icuuc.dll"), Cvoid,
(Ptr{Int},),
set)
# set : USet* in/out -> Ptr{Int}local ffi = require("ffi")
ffi.cdef[[
void uset_removeAllStrings(
intptr_t* set);
]]
local icuuc = ffi.load("icuuc")
-- icuuc.uset_removeAllStrings(set)
-- set : USet* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('icuuc.dll');
const uset_removeAllStrings = lib.func('__cdecl', 'uset_removeAllStrings', 'void', ['intptr_t *']);
// uset_removeAllStrings(set)
// set : USet* in/out -> 'intptr_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("icuuc.dll", {
uset_removeAllStrings: { parameters: ["pointer"], result: "void" },
});
// lib.symbols.uset_removeAllStrings(set)
// set : USet* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
void uset_removeAllStrings(
intptr_t* set);
C, "icuuc.dll");
// $ffi->uset_removeAllStrings(set);
// set : USet* in/out
// 構造体/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_removeAllStrings(
LongByReference set // USet* in/out
);
}@[Link("icuuc")]
lib Libicuuc
fun uset_removeAllStrings = uset_removeAllStrings(
set : LibC::SSizeT* # USet* in/out
) : Void
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef uset_removeAllStringsNative = Void Function(Pointer<IntPtr>);
typedef uset_removeAllStringsDart = void Function(Pointer<IntPtr>);
final uset_removeAllStrings = DynamicLibrary.open('icuuc.dll')
.lookupFunction<uset_removeAllStringsNative, uset_removeAllStringsDart>('uset_removeAllStrings');
// set : USet* in/out -> Pointer<IntPtr>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
procedure uset_removeAllStrings(
set: Pointer // USet* in/out
); cdecl;
external 'icuuc.dll' name 'uset_removeAllStrings';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import ccall safe "uset_removeAllStrings"
c_uset_removeAllStrings :: Ptr CIntPtr -> IO ()
-- set : USet* in/out -> Ptr CIntPtr
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let uset_removeallstrings =
foreign "uset_removeAllStrings"
((ptr intptr_t) @-> returning void)
(* set : USet* in/out -> (ptr intptr_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library icuuc (t "icuuc.dll"))
(cffi:use-foreign-library icuuc)
(cffi:defcfun ("uset_removeAllStrings" uset-remove-all-strings :convention :cdecl) :void
(set :pointer)) ; USet* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $uset_removeAllStrings = Win32::API::More->new('icuuc',
'void uset_removeAllStrings(LPVOID set)');
# my $ret = $uset_removeAllStrings->Call($set);
# set : USet* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。