ホーム › Globalization › uset_complementString
uset_complementString
関数指定文字列についてUSetの内容を反転する。
シグネチャ
// icu.dll
#include <windows.h>
void uset_complementString(
USet* set,
const WORD* str,
INT length
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| set | USet* | inout |
| str | WORD* | in |
| length | INT | in |
戻り値の型: void
各言語での呼び出し定義
// icu.dll
#include <windows.h>
void uset_complementString(
USet* set,
const WORD* str,
INT length
);[DllImport("icu.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void uset_complementString(
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_complementString(
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_complementString 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_complementString = ctypes.cdll.icu.uset_complementString
uset_complementString.restype = None
uset_complementString.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_complementString = Fiddle::Function.new(
lib['uset_complementString'],
[
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_complementString(
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_complementString(ref IntPtr set, ref ushort str, int length);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icu_uset_complementString' -Namespace Win32 -PassThru
# $api::uset_complementString(set, str, length)#uselib "icu.dll"
#func global uset_complementString "uset_complementString" sptr, sptr, sptr
; uset_complementString set, varptr(str), length
; set : USet* in/out -> "sptr"
; str : WORD* -> "sptr"
; length : INT -> "sptr"出力引数:
#uselib "icu.dll" #func global uset_complementString "uset_complementString" int, var, int ; uset_complementString set, str, length ; set : USet* in/out -> "int" ; str : WORD* -> "var" ; length : INT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icu.dll" #func global uset_complementString "uset_complementString" int, sptr, int ; uset_complementString set, varptr(str), length ; set : USet* in/out -> "int" ; str : WORD* -> "sptr" ; length : INT -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; void uset_complementString(USet* set, WORD* str, INT length) #uselib "icu.dll" #func global uset_complementString "uset_complementString" int, var, int ; uset_complementString set, str, length ; set : USet* in/out -> "int" ; str : WORD* -> "var" ; length : INT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; void uset_complementString(USet* set, WORD* str, INT length) #uselib "icu.dll" #func global uset_complementString "uset_complementString" int, intptr, int ; uset_complementString 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_complementString = icu.NewProc("uset_complementString")
)
// set (USet* in/out), str (WORD*), length (INT)
r1, _, err := procuset_complementString.Call(
uintptr(set),
uintptr(str),
uintptr(length),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure uset_complementString(
set: Pointer; // USet* in/out
str: Pointer; // WORD*
length: Integer // INT
); cdecl;
external 'icu.dll' name 'uset_complementString';result := DllCall("icu\uset_complementString"
, "Ptr", set ; USet* in/out
, "Ptr", str ; WORD*
, "Int", length ; INT
, "Cdecl Int") ; return: void●uset_complementString(set, str, length) = DLL("icu.dll", "int uset_complementString(void*, void*, int)")
# 呼び出し: uset_complementString(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`,…) を使用。