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