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

uloc_getISO3Language

関数
ロケールの3文字ISO言語コードを取得する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

LPSTR uloc_getISO3Language(
    LPCSTR localeID
);

パラメーター

名前方向
localeIDLPCSTRin

戻り値の型: LPSTR

各言語での呼び出し定義

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

LPSTR uloc_getISO3Language(
    LPCSTR localeID
);
[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr uloc_getISO3Language(
    [MarshalAs(UnmanagedType.LPStr)] string localeID   // LPCSTR
);
<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function uloc_getISO3Language(
    <MarshalAs(UnmanagedType.LPStr)> localeID As String   ' LPCSTR
) As IntPtr
End Function
' localeID : LPCSTR
Declare PtrSafe Function uloc_getISO3Language Lib "icuuc" ( _
    ByVal localeID As String) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

uloc_getISO3Language = ctypes.cdll.icuuc.uloc_getISO3Language
uloc_getISO3Language.restype = wintypes.LPSTR
uloc_getISO3Language.argtypes = [
    wintypes.LPCSTR,  # localeID : LPCSTR
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuuc.dll')
uloc_getISO3Language = Fiddle::Function.new(
  lib['uloc_getISO3Language'],
  [
    Fiddle::TYPE_VOIDP,  # localeID : LPCSTR
  ],
  Fiddle::TYPE_VOIDP, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn uloc_getISO3Language(
        localeID: *const u8  // LPCSTR
    ) -> *mut u8;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr uloc_getISO3Language([MarshalAs(UnmanagedType.LPStr)] string localeID);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_uloc_getISO3Language' -Namespace Win32 -PassThru
# $api::uloc_getISO3Language(localeID)
#uselib "icuuc.dll"
#func global uloc_getISO3Language "uloc_getISO3Language" sptr
; uloc_getISO3Language localeID   ; 戻り値は stat
; localeID : LPCSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "icuuc.dll"
#cfunc global uloc_getISO3Language "uloc_getISO3Language" str
; res = uloc_getISO3Language(localeID)
; localeID : LPCSTR -> "str"
; LPSTR uloc_getISO3Language(LPCSTR localeID)
#uselib "icuuc.dll"
#cfunc global uloc_getISO3Language "uloc_getISO3Language" str
; res = uloc_getISO3Language(localeID)
; localeID : LPCSTR -> "str"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	proculoc_getISO3Language = icuuc.NewProc("uloc_getISO3Language")
)

// localeID (LPCSTR)
r1, _, err := proculoc_getISO3Language.Call(
	uintptr(unsafe.Pointer(windows.BytePtrFromString(localeID))),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // LPSTR
function uloc_getISO3Language(
  localeID: PAnsiChar   // LPCSTR
): PAnsiChar; cdecl;
  external 'icuuc.dll' name 'uloc_getISO3Language';
result := DllCall("icuuc\uloc_getISO3Language"
    , "AStr", localeID   ; LPCSTR
    , "Cdecl Ptr")   ; return: LPSTR
●uloc_getISO3Language(localeID) = DLL("icuuc.dll", "char* uloc_getISO3Language(char*)")
# 呼び出し: uloc_getISO3Language(localeID)
# localeID : LPCSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。