Win32 API 日本語リファレンス
ホームGlobalization › uregion_getRegionFromNumericCode

uregion_getRegionFromNumericCode

関数
数値地域コードから地域オブジェクトを取得する。
DLLicuin.dll呼出規約cdecl

シグネチャ

// icuin.dll
#include <windows.h>

URegion* uregion_getRegionFromNumericCode(
    INT code,
    UErrorCode* status
);

パラメーター

名前方向
codeINTin
statusUErrorCode*inout

戻り値の型: URegion*

各言語での呼び出し定義

// icuin.dll
#include <windows.h>

URegion* uregion_getRegionFromNumericCode(
    INT code,
    UErrorCode* status
);
[DllImport("icuin.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr uregion_getRegionFromNumericCode(
    int code,   // INT
    ref int status   // UErrorCode* in/out
);
<DllImport("icuin.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function uregion_getRegionFromNumericCode(
    code As Integer,   ' INT
    ByRef status As Integer   ' UErrorCode* in/out
) As IntPtr
End Function
' code : INT
' status : UErrorCode* in/out
Declare PtrSafe Function uregion_getRegionFromNumericCode Lib "icuin" ( _
    ByVal code As Long, _
    ByRef status As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

uregion_getRegionFromNumericCode = ctypes.cdll.icuin.uregion_getRegionFromNumericCode
uregion_getRegionFromNumericCode.restype = ctypes.c_void_p
uregion_getRegionFromNumericCode.argtypes = [
    ctypes.c_int,  # code : INT
    ctypes.c_void_p,  # status : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuin.dll')
uregion_getRegionFromNumericCode = Fiddle::Function.new(
  lib['uregion_getRegionFromNumericCode'],
  [
    Fiddle::TYPE_INT,  # code : INT
    Fiddle::TYPE_VOIDP,  # status : UErrorCode* in/out
  ],
  Fiddle::TYPE_VOIDP, Fiddle::Function::CDECL)
#[link(name = "icuin")]
extern "C" {
    fn uregion_getRegionFromNumericCode(
        code: i32,  // INT
        status: *mut i32  // UErrorCode* in/out
    ) -> *mut isize;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr uregion_getRegionFromNumericCode(int code, ref int status);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_uregion_getRegionFromNumericCode' -Namespace Win32 -PassThru
# $api::uregion_getRegionFromNumericCode(code, status)
#uselib "icuin.dll"
#func global uregion_getRegionFromNumericCode "uregion_getRegionFromNumericCode" sptr, sptr
; uregion_getRegionFromNumericCode code, status   ; 戻り値は stat
; code : INT -> "sptr"
; status : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "icuin.dll"
#cfunc global uregion_getRegionFromNumericCode "uregion_getRegionFromNumericCode" int, int
; res = uregion_getRegionFromNumericCode(code, status)
; code : INT -> "int"
; status : UErrorCode* in/out -> "int"
; URegion* uregion_getRegionFromNumericCode(INT code, UErrorCode* status)
#uselib "icuin.dll"
#cfunc global uregion_getRegionFromNumericCode "uregion_getRegionFromNumericCode" int, int
; res = uregion_getRegionFromNumericCode(code, status)
; code : INT -> "int"
; status : UErrorCode* in/out -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procuregion_getRegionFromNumericCode = icuin.NewProc("uregion_getRegionFromNumericCode")
)

// code (INT), status (UErrorCode* in/out)
r1, _, err := procuregion_getRegionFromNumericCode.Call(
	uintptr(code),
	uintptr(status),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // URegion*
function uregion_getRegionFromNumericCode(
  code: Integer;   // INT
  status: Pointer   // UErrorCode* in/out
): Pointer; cdecl;
  external 'icuin.dll' name 'uregion_getRegionFromNumericCode';
result := DllCall("icuin\uregion_getRegionFromNumericCode"
    , "Int", code   ; INT
    , "Ptr", status   ; UErrorCode* in/out
    , "Cdecl Ptr")   ; return: URegion*
●uregion_getRegionFromNumericCode(code, status) = DLL("icuin.dll", "void* uregion_getRegionFromNumericCode(int, void*)")
# 呼び出し: uregion_getRegionFromNumericCode(code, status)
# code : INT -> "int"
# status : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。