ホーム › Globalization › umsg_autoQuoteApostrophe
umsg_autoQuoteApostrophe
関数パターン中のアポストロフィを自動的に引用化する。
シグネチャ
// icuin.dll
#include <windows.h>
INT umsg_autoQuoteApostrophe(
const WORD* pattern,
INT patternLength,
WORD* dest,
INT destCapacity,
UErrorCode* ec
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pattern | WORD* | in |
| patternLength | INT | in |
| dest | WORD* | inout |
| destCapacity | INT | in |
| ec | UErrorCode* | inout |
戻り値の型: INT
各言語での呼び出し定義
// icuin.dll
#include <windows.h>
INT umsg_autoQuoteApostrophe(
const WORD* pattern,
INT patternLength,
WORD* dest,
INT destCapacity,
UErrorCode* ec
);[DllImport("icuin.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern int umsg_autoQuoteApostrophe(
ref ushort pattern, // WORD*
int patternLength, // INT
ref ushort dest, // WORD* in/out
int destCapacity, // INT
ref int ec // UErrorCode* in/out
);<DllImport("icuin.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function umsg_autoQuoteApostrophe(
ByRef pattern As UShort, ' WORD*
patternLength As Integer, ' INT
ByRef dest As UShort, ' WORD* in/out
destCapacity As Integer, ' INT
ByRef ec As Integer ' UErrorCode* in/out
) As Integer
End Function' pattern : WORD*
' patternLength : INT
' dest : WORD* in/out
' destCapacity : INT
' ec : UErrorCode* in/out
Declare PtrSafe Function umsg_autoQuoteApostrophe Lib "icuin" ( _
ByRef pattern As Integer, _
ByVal patternLength As Long, _
ByRef dest As Integer, _
ByVal destCapacity As Long, _
ByRef ec As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
umsg_autoQuoteApostrophe = ctypes.cdll.icuin.umsg_autoQuoteApostrophe
umsg_autoQuoteApostrophe.restype = ctypes.c_int
umsg_autoQuoteApostrophe.argtypes = [
ctypes.POINTER(ctypes.c_ushort), # pattern : WORD*
ctypes.c_int, # patternLength : INT
ctypes.POINTER(ctypes.c_ushort), # dest : WORD* in/out
ctypes.c_int, # destCapacity : INT
ctypes.c_void_p, # ec : UErrorCode* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuin.dll')
umsg_autoQuoteApostrophe = Fiddle::Function.new(
lib['umsg_autoQuoteApostrophe'],
[
Fiddle::TYPE_VOIDP, # pattern : WORD*
Fiddle::TYPE_INT, # patternLength : INT
Fiddle::TYPE_VOIDP, # dest : WORD* in/out
Fiddle::TYPE_INT, # destCapacity : INT
Fiddle::TYPE_VOIDP, # ec : UErrorCode* in/out
],
Fiddle::TYPE_INT, Fiddle::Function::CDECL)#[link(name = "icuin")]
extern "C" {
fn umsg_autoQuoteApostrophe(
pattern: *const u16, // WORD*
patternLength: i32, // INT
dest: *mut u16, // WORD* in/out
destCapacity: i32, // INT
ec: *mut i32 // UErrorCode* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int umsg_autoQuoteApostrophe(ref ushort pattern, int patternLength, ref ushort dest, int destCapacity, ref int ec);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_umsg_autoQuoteApostrophe' -Namespace Win32 -PassThru
# $api::umsg_autoQuoteApostrophe(pattern, patternLength, dest, destCapacity, ec)#uselib "icuin.dll"
#func global umsg_autoQuoteApostrophe "umsg_autoQuoteApostrophe" sptr, sptr, sptr, sptr, sptr
; umsg_autoQuoteApostrophe varptr(pattern), patternLength, varptr(dest), destCapacity, ec ; 戻り値は stat
; pattern : WORD* -> "sptr"
; patternLength : INT -> "sptr"
; dest : WORD* in/out -> "sptr"
; destCapacity : INT -> "sptr"
; ec : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "icuin.dll" #cfunc global umsg_autoQuoteApostrophe "umsg_autoQuoteApostrophe" var, int, var, int, int ; res = umsg_autoQuoteApostrophe(pattern, patternLength, dest, destCapacity, ec) ; pattern : WORD* -> "var" ; patternLength : INT -> "int" ; dest : WORD* in/out -> "var" ; destCapacity : INT -> "int" ; ec : UErrorCode* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icuin.dll" #cfunc global umsg_autoQuoteApostrophe "umsg_autoQuoteApostrophe" sptr, int, sptr, int, int ; res = umsg_autoQuoteApostrophe(varptr(pattern), patternLength, varptr(dest), destCapacity, ec) ; pattern : WORD* -> "sptr" ; patternLength : INT -> "int" ; dest : WORD* in/out -> "sptr" ; destCapacity : INT -> "int" ; ec : UErrorCode* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; INT umsg_autoQuoteApostrophe(WORD* pattern, INT patternLength, WORD* dest, INT destCapacity, UErrorCode* ec) #uselib "icuin.dll" #cfunc global umsg_autoQuoteApostrophe "umsg_autoQuoteApostrophe" var, int, var, int, int ; res = umsg_autoQuoteApostrophe(pattern, patternLength, dest, destCapacity, ec) ; pattern : WORD* -> "var" ; patternLength : INT -> "int" ; dest : WORD* in/out -> "var" ; destCapacity : INT -> "int" ; ec : UErrorCode* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; INT umsg_autoQuoteApostrophe(WORD* pattern, INT patternLength, WORD* dest, INT destCapacity, UErrorCode* ec) #uselib "icuin.dll" #cfunc global umsg_autoQuoteApostrophe "umsg_autoQuoteApostrophe" intptr, int, intptr, int, int ; res = umsg_autoQuoteApostrophe(varptr(pattern), patternLength, varptr(dest), destCapacity, ec) ; pattern : WORD* -> "intptr" ; patternLength : INT -> "int" ; dest : WORD* in/out -> "intptr" ; destCapacity : INT -> "int" ; ec : UErrorCode* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuin = windows.NewLazySystemDLL("icuin.dll")
procumsg_autoQuoteApostrophe = icuin.NewProc("umsg_autoQuoteApostrophe")
)
// pattern (WORD*), patternLength (INT), dest (WORD* in/out), destCapacity (INT), ec (UErrorCode* in/out)
r1, _, err := procumsg_autoQuoteApostrophe.Call(
uintptr(pattern),
uintptr(patternLength),
uintptr(dest),
uintptr(destCapacity),
uintptr(ec),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction umsg_autoQuoteApostrophe(
pattern: Pointer; // WORD*
patternLength: Integer; // INT
dest: Pointer; // WORD* in/out
destCapacity: Integer; // INT
ec: Pointer // UErrorCode* in/out
): Integer; cdecl;
external 'icuin.dll' name 'umsg_autoQuoteApostrophe';result := DllCall("icuin\umsg_autoQuoteApostrophe"
, "Ptr", pattern ; WORD*
, "Int", patternLength ; INT
, "Ptr", dest ; WORD* in/out
, "Int", destCapacity ; INT
, "Ptr", ec ; UErrorCode* in/out
, "Cdecl Int") ; return: INT●umsg_autoQuoteApostrophe(pattern, patternLength, dest, destCapacity, ec) = DLL("icuin.dll", "int umsg_autoQuoteApostrophe(void*, int, void*, int, void*)")
# 呼び出し: umsg_autoQuoteApostrophe(pattern, patternLength, dest, destCapacity, ec)
# pattern : WORD* -> "void*"
# patternLength : INT -> "int"
# dest : WORD* in/out -> "void*"
# destCapacity : INT -> "int"
# ec : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。