Win32 API 日本語リファレンス
ホームGlobalization › ufmt_close

ufmt_close

関数
フォーマット可能オブジェクトを閉じて解放する。
DLLicuin.dll呼出規約cdecl

シグネチャ

// icuin.dll
#include <windows.h>

void ufmt_close(
    void** fmt
);

パラメーター

名前方向説明
fmtvoid**inout解放するFormattable(書式化可能値)のハンドル。

戻り値の型: void

各言語での呼び出し定義

// icuin.dll
#include <windows.h>

void ufmt_close(
    void** fmt
);
[DllImport("icuin.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void ufmt_close(
    IntPtr fmt   // void** in/out
);
<DllImport("icuin.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub ufmt_close(
    fmt As IntPtr   ' void** in/out
)
End Sub
' fmt : void** in/out
Declare PtrSafe Sub ufmt_close Lib "icuin" ( _
    ByVal fmt As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ufmt_close = ctypes.cdll.icuin.ufmt_close
ufmt_close.restype = None
ufmt_close.argtypes = [
    ctypes.c_void_p,  # fmt : void** in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuin.dll')
ufmt_close = Fiddle::Function.new(
  lib['ufmt_close'],
  [
    Fiddle::TYPE_VOIDP,  # fmt : void** in/out
  ],
  Fiddle::TYPE_VOID, Fiddle::Function::CDECL)
#[link(name = "icuin")]
extern "C" {
    fn ufmt_close(
        fmt: *mut *mut ()  // void** in/out
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void ufmt_close(IntPtr fmt);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_ufmt_close' -Namespace Win32 -PassThru
# $api::ufmt_close(fmt)
#uselib "icuin.dll"
#func global ufmt_close "ufmt_close" sptr
; ufmt_close fmt
; fmt : void** in/out -> "sptr"
#uselib "icuin.dll"
#func global ufmt_close "ufmt_close" sptr
; ufmt_close fmt
; fmt : void** in/out -> "sptr"
; void ufmt_close(void** fmt)
#uselib "icuin.dll"
#func global ufmt_close "ufmt_close" intptr
; ufmt_close fmt
; fmt : void** in/out -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procufmt_close = icuin.NewProc("ufmt_close")
)

// fmt (void** in/out)
r1, _, err := procufmt_close.Call(
	uintptr(fmt),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // void
procedure ufmt_close(
  fmt: Pointer   // void** in/out
); cdecl;
  external 'icuin.dll' name 'ufmt_close';
result := DllCall("icuin\ufmt_close"
    , "Ptr", fmt   ; void** in/out
    , "Cdecl Int")   ; return: void
●ufmt_close(fmt) = DLL("icuin.dll", "int ufmt_close(void*)")
# 呼び出し: ufmt_close(fmt)
# fmt : void** in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。
const std = @import("std");

extern "icuin" fn ufmt_close(
    fmt: ?*anyopaque // void** in/out
) callconv(.c) void;
proc ufmt_close(
    fmt: pointer  # void** in/out
) {.importc: "ufmt_close", cdecl, dynlib: "icuin.dll".}
pragma(lib, "icuin");
extern(C)
void ufmt_close(
    void** fmt   // void** in/out
);
ccall((:ufmt_close, "icuin.dll"), Cvoid,
      (Ptr{Cvoid},),
      fmt)
# fmt : void** in/out -> Ptr{Cvoid}
local ffi = require("ffi")
ffi.cdef[[
void ufmt_close(
    void** fmt);
]]
local icuin = ffi.load("icuin")
-- icuin.ufmt_close(fmt)
-- fmt : void** in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('icuin.dll');
const ufmt_close = lib.func('__cdecl', 'ufmt_close', 'void', ['void *']);
// ufmt_close(fmt)
// fmt : void** in/out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("icuin.dll", {
  ufmt_close: { parameters: ["pointer"], result: "void" },
});
// lib.symbols.ufmt_close(fmt)
// fmt : void** in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
void ufmt_close(
    void** fmt);
C, "icuin.dll");
// $ffi->ufmt_close(fmt);
// fmt : void** 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 Icuin extends Library {
    Icuin INSTANCE = Native.load("icuin", Icuin.class);
    void ufmt_close(
        Pointer fmt   // void** in/out
    );
}
@[Link("icuin")]
lib Libicuin
  fun ufmt_close = ufmt_close(
    fmt : Void**   # void** in/out
  ) : Void
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef ufmt_closeNative = Void Function(Pointer<Void>);
typedef ufmt_closeDart = void Function(Pointer<Void>);
final ufmt_close = DynamicLibrary.open('icuin.dll')
    .lookupFunction<ufmt_closeNative, ufmt_closeDart>('ufmt_close');
// fmt : void** in/out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
procedure ufmt_close(
  fmt: Pointer   // void** in/out
); cdecl;
  external 'icuin.dll' name 'ufmt_close';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import ccall safe "ufmt_close"
  c_ufmt_close :: Ptr () -> IO ()
-- fmt : void** in/out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let ufmt_close =
  foreign "ufmt_close"
    ((ptr void) @-> returning void)
(* fmt : void** in/out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library icuin (t "icuin.dll"))
(cffi:use-foreign-library icuin)

(cffi:defcfun ("ufmt_close" ufmt-close :convention :cdecl) :void
  (fmt :pointer))   ; void** in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $ufmt_close = Win32::API::More->new('icuin',
    'void ufmt_close(LPVOID fmt)');
# my $ret = $ufmt_close->Call($fmt);
# fmt : void** in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。