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

uscript_getName

関数
スクリプトコードからスクリプトの正式名称を取得する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

LPSTR uscript_getName(
    UScriptCode scriptCode
);

パラメーター

名前方向
scriptCodeUScriptCodein

戻り値の型: LPSTR

各言語での呼び出し定義

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

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

uscript_getName = ctypes.cdll.icuuc.uscript_getName
uscript_getName.restype = wintypes.LPSTR
uscript_getName.argtypes = [
    ctypes.c_int,  # scriptCode : UScriptCode
]
require 'fiddle'
require 'fiddle/import'

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

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procuscript_getName = icuuc.NewProc("uscript_getName")
)

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