ホーム › Globalization › udat_countSymbols
udat_countSymbols
関数指定種別の日付記号の個数を返す。
シグネチャ
// icuin.dll
#include <windows.h>
INT udat_countSymbols(
const void** fmt,
UDateFormatSymbolType type
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| fmt | void** | in |
| type | UDateFormatSymbolType | in |
戻り値の型: INT
各言語での呼び出し定義
// icuin.dll
#include <windows.h>
INT udat_countSymbols(
const void** fmt,
UDateFormatSymbolType type
);[DllImport("icuin.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern int udat_countSymbols(
IntPtr fmt, // void**
int type // UDateFormatSymbolType
);<DllImport("icuin.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function udat_countSymbols(
fmt As IntPtr, ' void**
type As Integer ' UDateFormatSymbolType
) As Integer
End Function' fmt : void**
' type : UDateFormatSymbolType
Declare PtrSafe Function udat_countSymbols Lib "icuin" ( _
ByVal fmt As LongPtr, _
ByVal type As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
udat_countSymbols = ctypes.cdll.icuin.udat_countSymbols
udat_countSymbols.restype = ctypes.c_int
udat_countSymbols.argtypes = [
ctypes.c_void_p, # fmt : void**
ctypes.c_int, # type : UDateFormatSymbolType
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuin.dll')
udat_countSymbols = Fiddle::Function.new(
lib['udat_countSymbols'],
[
Fiddle::TYPE_VOIDP, # fmt : void**
Fiddle::TYPE_INT, # type : UDateFormatSymbolType
],
Fiddle::TYPE_INT, Fiddle::Function::CDECL)#[link(name = "icuin")]
extern "C" {
fn udat_countSymbols(
fmt: *const *const (), // void**
type: i32 // UDateFormatSymbolType
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int udat_countSymbols(IntPtr fmt, int type);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_udat_countSymbols' -Namespace Win32 -PassThru
# $api::udat_countSymbols(fmt, type)#uselib "icuin.dll"
#func global udat_countSymbols "udat_countSymbols" sptr, sptr
; udat_countSymbols fmt, type ; 戻り値は stat
; fmt : void** -> "sptr"
; type : UDateFormatSymbolType -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "icuin.dll"
#cfunc global udat_countSymbols "udat_countSymbols" sptr, int
; res = udat_countSymbols(fmt, type)
; fmt : void** -> "sptr"
; type : UDateFormatSymbolType -> "int"; INT udat_countSymbols(void** fmt, UDateFormatSymbolType type)
#uselib "icuin.dll"
#cfunc global udat_countSymbols "udat_countSymbols" intptr, int
; res = udat_countSymbols(fmt, type)
; fmt : void** -> "intptr"
; type : UDateFormatSymbolType -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuin = windows.NewLazySystemDLL("icuin.dll")
procudat_countSymbols = icuin.NewProc("udat_countSymbols")
)
// fmt (void**), type (UDateFormatSymbolType)
r1, _, err := procudat_countSymbols.Call(
uintptr(fmt),
uintptr(type),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction udat_countSymbols(
fmt: Pointer; // void**
type: Integer // UDateFormatSymbolType
): Integer; cdecl;
external 'icuin.dll' name 'udat_countSymbols';result := DllCall("icuin\udat_countSymbols"
, "Ptr", fmt ; void**
, "Int", type ; UDateFormatSymbolType
, "Cdecl Int") ; return: INT●udat_countSymbols(fmt, type) = DLL("icuin.dll", "int udat_countSymbols(void*, int)")
# 呼び出し: udat_countSymbols(fmt, type)
# fmt : void** -> "void*"
# type : UDateFormatSymbolType -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。