ホーム › Globalization › ucasemap_setLocale
ucasemap_setLocale
関数大文字小文字変換マップにロケールを設定する。
シグネチャ
// icuuc.dll
#include <windows.h>
void ucasemap_setLocale(
UCaseMap* csm,
LPCSTR locale,
UErrorCode* pErrorCode
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| csm | UCaseMap* | inout |
| locale | LPCSTR | in |
| pErrorCode | UErrorCode* | inout |
戻り値の型: void
各言語での呼び出し定義
// icuuc.dll
#include <windows.h>
void ucasemap_setLocale(
UCaseMap* csm,
LPCSTR locale,
UErrorCode* pErrorCode
);[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void ucasemap_setLocale(
ref IntPtr csm, // UCaseMap* in/out
[MarshalAs(UnmanagedType.LPStr)] string locale, // LPCSTR
ref int pErrorCode // UErrorCode* in/out
);<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub ucasemap_setLocale(
ByRef csm As IntPtr, ' UCaseMap* in/out
<MarshalAs(UnmanagedType.LPStr)> locale As String, ' LPCSTR
ByRef pErrorCode As Integer ' UErrorCode* in/out
)
End Sub' csm : UCaseMap* in/out
' locale : LPCSTR
' pErrorCode : UErrorCode* in/out
Declare PtrSafe Sub ucasemap_setLocale Lib "icuuc" ( _
ByRef csm As LongPtr, _
ByVal locale As String, _
ByRef pErrorCode As Long)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ucasemap_setLocale = ctypes.cdll.icuuc.ucasemap_setLocale
ucasemap_setLocale.restype = None
ucasemap_setLocale.argtypes = [
ctypes.c_void_p, # csm : UCaseMap* in/out
wintypes.LPCSTR, # locale : LPCSTR
ctypes.c_void_p, # pErrorCode : UErrorCode* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuuc.dll')
ucasemap_setLocale = Fiddle::Function.new(
lib['ucasemap_setLocale'],
[
Fiddle::TYPE_VOIDP, # csm : UCaseMap* in/out
Fiddle::TYPE_VOIDP, # locale : LPCSTR
Fiddle::TYPE_VOIDP, # pErrorCode : UErrorCode* in/out
],
Fiddle::TYPE_VOID, Fiddle::Function::CDECL)#[link(name = "icuuc")]
extern "C" {
fn ucasemap_setLocale(
csm: *mut isize, // UCaseMap* in/out
locale: *const u8, // LPCSTR
pErrorCode: *mut i32 // UErrorCode* in/out
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void ucasemap_setLocale(ref IntPtr csm, [MarshalAs(UnmanagedType.LPStr)] string locale, ref int pErrorCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_ucasemap_setLocale' -Namespace Win32 -PassThru
# $api::ucasemap_setLocale(csm, locale, pErrorCode)#uselib "icuuc.dll"
#func global ucasemap_setLocale "ucasemap_setLocale" sptr, sptr, sptr
; ucasemap_setLocale csm, locale, pErrorCode
; csm : UCaseMap* in/out -> "sptr"
; locale : LPCSTR -> "sptr"
; pErrorCode : UErrorCode* in/out -> "sptr"#uselib "icuuc.dll"
#func global ucasemap_setLocale "ucasemap_setLocale" int, str, int
; ucasemap_setLocale csm, locale, pErrorCode
; csm : UCaseMap* in/out -> "int"
; locale : LPCSTR -> "str"
; pErrorCode : UErrorCode* in/out -> "int"; void ucasemap_setLocale(UCaseMap* csm, LPCSTR locale, UErrorCode* pErrorCode)
#uselib "icuuc.dll"
#func global ucasemap_setLocale "ucasemap_setLocale" int, str, int
; ucasemap_setLocale csm, locale, pErrorCode
; csm : UCaseMap* in/out -> "int"
; locale : LPCSTR -> "str"
; pErrorCode : UErrorCode* in/out -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuuc = windows.NewLazySystemDLL("icuuc.dll")
procucasemap_setLocale = icuuc.NewProc("ucasemap_setLocale")
)
// csm (UCaseMap* in/out), locale (LPCSTR), pErrorCode (UErrorCode* in/out)
r1, _, err := procucasemap_setLocale.Call(
uintptr(csm),
uintptr(unsafe.Pointer(windows.BytePtrFromString(locale))),
uintptr(pErrorCode),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure ucasemap_setLocale(
csm: Pointer; // UCaseMap* in/out
locale: PAnsiChar; // LPCSTR
pErrorCode: Pointer // UErrorCode* in/out
); cdecl;
external 'icuuc.dll' name 'ucasemap_setLocale';result := DllCall("icuuc\ucasemap_setLocale"
, "Ptr", csm ; UCaseMap* in/out
, "AStr", locale ; LPCSTR
, "Ptr", pErrorCode ; UErrorCode* in/out
, "Cdecl Int") ; return: void●ucasemap_setLocale(csm, locale, pErrorCode) = DLL("icuuc.dll", "int ucasemap_setLocale(void*, char*, void*)")
# 呼び出し: ucasemap_setLocale(csm, locale, pErrorCode)
# csm : UCaseMap* in/out -> "void*"
# locale : LPCSTR -> "char*"
# pErrorCode : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。