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