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

ucsdet_enableInputFilter

関数
文字セット判定の入力フィルタを有効化する。
DLLicuin.dll呼出規約cdecl

シグネチャ

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

CHAR ucsdet_enableInputFilter(
    UCharsetDetector* ucsd,
    CHAR filter
);

パラメーター

名前方向
ucsdUCharsetDetector*inout
filterCHARin

戻り値の型: CHAR

各言語での呼び出し定義

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

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

ucsdet_enableInputFilter = ctypes.cdll.icuin.ucsdet_enableInputFilter
ucsdet_enableInputFilter.restype = ctypes.c_byte
ucsdet_enableInputFilter.argtypes = [
    ctypes.c_void_p,  # ucsd : UCharsetDetector* in/out
    ctypes.c_byte,  # filter : CHAR
]
require 'fiddle'
require 'fiddle/import'

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

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procucsdet_enableInputFilter = icuin.NewProc("ucsdet_enableInputFilter")
)

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