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