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