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