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