ホーム › Globalization › utrace_getLevel
utrace_getLevel
関数ICUのトレース出力レベルを取得する。
シグネチャ
// icuuc.dll
#include <windows.h>
INT utrace_getLevel(void);パラメーターなし。戻り値: INT
各言語での呼び出し定義
// icuuc.dll
#include <windows.h>
INT utrace_getLevel(void);[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern int utrace_getLevel();<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function utrace_getLevel() As Integer
End FunctionDeclare PtrSafe Function utrace_getLevel Lib "icuuc" () As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
utrace_getLevel = ctypes.cdll.icuuc.utrace_getLevel
utrace_getLevel.restype = ctypes.c_int
utrace_getLevel.argtypes = []require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuuc.dll')
utrace_getLevel = Fiddle::Function.new(
lib['utrace_getLevel'],
[],
Fiddle::TYPE_INT, Fiddle::Function::CDECL)#[link(name = "icuuc")]
extern "C" {
fn utrace_getLevel() -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int utrace_getLevel();
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_utrace_getLevel' -Namespace Win32 -PassThru
# $api::utrace_getLevel()#uselib "icuuc.dll"
#func global utrace_getLevel "utrace_getLevel"
; utrace_getLevel ; 戻り値は stat
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "icuuc.dll"
#cfunc global utrace_getLevel "utrace_getLevel"
; res = utrace_getLevel(); INT utrace_getLevel()
#uselib "icuuc.dll"
#cfunc global utrace_getLevel "utrace_getLevel"
; res = utrace_getLevel()import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuuc = windows.NewLazySystemDLL("icuuc.dll")
procutrace_getLevel = icuuc.NewProc("utrace_getLevel")
)
r1, _, err := procutrace_getLevel.Call()
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction utrace_getLevel: Integer; cdecl;
external 'icuuc.dll' name 'utrace_getLevel';result := DllCall("icuuc\utrace_getLevel", "Cdecl Int")●utrace_getLevel() = DLL("icuuc.dll", "int utrace_getLevel()")
# 呼び出し: utrace_getLevel()
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。const std = @import("std");
extern "icuuc" fn utrace_getLevel() callconv(.c) i32;proc utrace_getLevel(): int32 {.importc: "utrace_getLevel", cdecl, dynlib: "icuuc.dll".}pragma(lib, "icuuc");
extern(C)
int utrace_getLevel();ccall((:utrace_getLevel, "icuuc.dll"), Int32,
(),
)local ffi = require("ffi")
ffi.cdef[[
int32_t utrace_getLevel(void);
]]
local icuuc = ffi.load("icuuc")
-- icuuc.utrace_getLevel()
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('icuuc.dll');
const utrace_getLevel = lib.func('__cdecl', 'utrace_getLevel', 'int32_t', []);
// utrace_getLevel()
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("icuuc.dll", {
utrace_getLevel: { parameters: [], result: "i32" },
});
// lib.symbols.utrace_getLevel()
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t utrace_getLevel(void);
C, "icuuc.dll");
// $ffi->utrace_getLevel();
// 構造体/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);
int utrace_getLevel();
}@[Link("icuuc")]
lib Libicuuc
fun utrace_getLevel = utrace_getLevel() : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef utrace_getLevelNative = Int32 Function();
typedef utrace_getLevelDart = int Function();
final utrace_getLevel = DynamicLibrary.open('icuuc.dll')
.lookupFunction<utrace_getLevelNative, utrace_getLevelDart>('utrace_getLevel');
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function utrace_getLevel: Integer; cdecl;
external 'icuuc.dll' name 'utrace_getLevel';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import ccall safe "utrace_getLevel"
c_utrace_getLevel :: IO Int32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let utrace_getlevel =
foreign "utrace_getLevel"
(void @-> returning int32_t)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library icuuc (t "icuuc.dll"))
(cffi:use-foreign-library icuuc)
(cffi:defcfun ("utrace_getLevel" utrace-get-level :convention :cdecl) :int32)
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $utrace_getLevel = Win32::API::More->new('icuuc',
'int utrace_getLevel()');
# my $ret = $utrace_getLevel->Call();
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。