ホーム › Globalization › ulocdata_setNoSubstitute
ulocdata_setNoSubstitute
関数ロケールデータの代替不使用設定を行う。
シグネチャ
// icuin.dll
#include <windows.h>
void ulocdata_setNoSubstitute(
ULocaleData* uld,
CHAR setting
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| uld | ULocaleData* | inout | 代替動作を設定する対象のロケールデータオブジェクトのハンドル。 |
| setting | CHAR | in | 真(非0)でデータ欠落時に代替値を返さない設定にする。 |
戻り値の型: void
各言語での呼び出し定義
// icuin.dll
#include <windows.h>
void ulocdata_setNoSubstitute(
ULocaleData* uld,
CHAR setting
);[DllImport("icuin.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void ulocdata_setNoSubstitute(
ref IntPtr uld, // ULocaleData* in/out
sbyte setting // CHAR
);<DllImport("icuin.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub ulocdata_setNoSubstitute(
ByRef uld As IntPtr, ' ULocaleData* in/out
setting As SByte ' CHAR
)
End Sub' uld : ULocaleData* in/out
' setting : CHAR
Declare PtrSafe Sub ulocdata_setNoSubstitute Lib "icuin" ( _
ByRef uld As LongPtr, _
ByVal setting As Byte)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ulocdata_setNoSubstitute = ctypes.cdll.icuin.ulocdata_setNoSubstitute
ulocdata_setNoSubstitute.restype = None
ulocdata_setNoSubstitute.argtypes = [
ctypes.c_void_p, # uld : ULocaleData* in/out
ctypes.c_byte, # setting : CHAR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuin.dll')
ulocdata_setNoSubstitute = Fiddle::Function.new(
lib['ulocdata_setNoSubstitute'],
[
Fiddle::TYPE_VOIDP, # uld : ULocaleData* in/out
Fiddle::TYPE_CHAR, # setting : CHAR
],
Fiddle::TYPE_VOID, Fiddle::Function::CDECL)#[link(name = "icuin")]
extern "C" {
fn ulocdata_setNoSubstitute(
uld: *mut isize, // ULocaleData* in/out
setting: i8 // CHAR
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void ulocdata_setNoSubstitute(ref IntPtr uld, sbyte setting);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_ulocdata_setNoSubstitute' -Namespace Win32 -PassThru
# $api::ulocdata_setNoSubstitute(uld, setting)#uselib "icuin.dll"
#func global ulocdata_setNoSubstitute "ulocdata_setNoSubstitute" sptr, sptr
; ulocdata_setNoSubstitute varptr(uld), setting
; uld : ULocaleData* in/out -> "sptr"
; setting : CHAR -> "sptr"出力引数:
#uselib "icuin.dll" #func global ulocdata_setNoSubstitute "ulocdata_setNoSubstitute" var, int ; ulocdata_setNoSubstitute uld, setting ; uld : ULocaleData* in/out -> "var" ; setting : CHAR -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icuin.dll" #func global ulocdata_setNoSubstitute "ulocdata_setNoSubstitute" sptr, int ; ulocdata_setNoSubstitute varptr(uld), setting ; uld : ULocaleData* in/out -> "sptr" ; setting : CHAR -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; void ulocdata_setNoSubstitute(ULocaleData* uld, CHAR setting) #uselib "icuin.dll" #func global ulocdata_setNoSubstitute "ulocdata_setNoSubstitute" var, int ; ulocdata_setNoSubstitute uld, setting ; uld : ULocaleData* in/out -> "var" ; setting : CHAR -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; void ulocdata_setNoSubstitute(ULocaleData* uld, CHAR setting) #uselib "icuin.dll" #func global ulocdata_setNoSubstitute "ulocdata_setNoSubstitute" intptr, int ; ulocdata_setNoSubstitute varptr(uld), setting ; uld : ULocaleData* in/out -> "intptr" ; setting : CHAR -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuin = windows.NewLazySystemDLL("icuin.dll")
proculocdata_setNoSubstitute = icuin.NewProc("ulocdata_setNoSubstitute")
)
// uld (ULocaleData* in/out), setting (CHAR)
r1, _, err := proculocdata_setNoSubstitute.Call(
uintptr(uld),
uintptr(setting),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure ulocdata_setNoSubstitute(
uld: Pointer; // ULocaleData* in/out
setting: Shortint // CHAR
); cdecl;
external 'icuin.dll' name 'ulocdata_setNoSubstitute';result := DllCall("icuin\ulocdata_setNoSubstitute"
, "Ptr", uld ; ULocaleData* in/out
, "Char", setting ; CHAR
, "Cdecl Int") ; return: void●ulocdata_setNoSubstitute(uld, setting) = DLL("icuin.dll", "int ulocdata_setNoSubstitute(void*, char)")
# 呼び出し: ulocdata_setNoSubstitute(uld, setting)
# uld : ULocaleData* in/out -> "void*"
# setting : CHAR -> "char"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。const std = @import("std");
extern "icuin" fn ulocdata_setNoSubstitute(
uld: [*c]isize, // ULocaleData* in/out
setting: i8 // CHAR
) callconv(.c) void;proc ulocdata_setNoSubstitute(
uld: ptr int, # ULocaleData* in/out
setting: int8 # CHAR
) {.importc: "ulocdata_setNoSubstitute", cdecl, dynlib: "icuin.dll".}pragma(lib, "icuin");
extern(C)
void ulocdata_setNoSubstitute(
ptrdiff_t* uld, // ULocaleData* in/out
byte setting // CHAR
);ccall((:ulocdata_setNoSubstitute, "icuin.dll"), Cvoid,
(Ptr{Int}, Int8),
uld, setting)
# uld : ULocaleData* in/out -> Ptr{Int}
# setting : CHAR -> Int8local ffi = require("ffi")
ffi.cdef[[
void ulocdata_setNoSubstitute(
intptr_t* uld,
int8_t setting);
]]
local icuin = ffi.load("icuin")
-- icuin.ulocdata_setNoSubstitute(uld, setting)
-- uld : ULocaleData* in/out
-- setting : CHAR
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('icuin.dll');
const ulocdata_setNoSubstitute = lib.func('__cdecl', 'ulocdata_setNoSubstitute', 'void', ['intptr_t *', 'int8_t']);
// ulocdata_setNoSubstitute(uld, setting)
// uld : ULocaleData* in/out -> 'intptr_t *'
// setting : CHAR -> 'int8_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("icuin.dll", {
ulocdata_setNoSubstitute: { parameters: ["pointer", "i8"], result: "void" },
});
// lib.symbols.ulocdata_setNoSubstitute(uld, setting)
// uld : ULocaleData* in/out -> "pointer"
// setting : CHAR -> "i8"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
void ulocdata_setNoSubstitute(
intptr_t* uld,
int8_t setting);
C, "icuin.dll");
// $ffi->ulocdata_setNoSubstitute(uld, setting);
// uld : ULocaleData* in/out
// setting : CHAR
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Icuin extends Library {
Icuin INSTANCE = Native.load("icuin", Icuin.class);
void ulocdata_setNoSubstitute(
LongByReference uld, // ULocaleData* in/out
byte setting // CHAR
);
}@[Link("icuin")]
lib Libicuin
fun ulocdata_setNoSubstitute = ulocdata_setNoSubstitute(
uld : LibC::SSizeT*, # ULocaleData* in/out
setting : Int8 # CHAR
) : Void
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef ulocdata_setNoSubstituteNative = Void Function(Pointer<IntPtr>, Int8);
typedef ulocdata_setNoSubstituteDart = void Function(Pointer<IntPtr>, int);
final ulocdata_setNoSubstitute = DynamicLibrary.open('icuin.dll')
.lookupFunction<ulocdata_setNoSubstituteNative, ulocdata_setNoSubstituteDart>('ulocdata_setNoSubstitute');
// uld : ULocaleData* in/out -> Pointer<IntPtr>
// setting : CHAR -> Int8
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
procedure ulocdata_setNoSubstitute(
uld: Pointer; // ULocaleData* in/out
setting: Shortint // CHAR
); cdecl;
external 'icuin.dll' name 'ulocdata_setNoSubstitute';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import ccall safe "ulocdata_setNoSubstitute"
c_ulocdata_setNoSubstitute :: Ptr CIntPtr -> Int8 -> IO ()
-- uld : ULocaleData* in/out -> Ptr CIntPtr
-- setting : CHAR -> Int8
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let ulocdata_setnosubstitute =
foreign "ulocdata_setNoSubstitute"
((ptr intptr_t) @-> int8_t @-> returning void)
(* uld : ULocaleData* in/out -> (ptr intptr_t) *)
(* setting : CHAR -> int8_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library icuin (t "icuin.dll"))
(cffi:use-foreign-library icuin)
(cffi:defcfun ("ulocdata_setNoSubstitute" ulocdata-set-no-substitute :convention :cdecl) :void
(uld :pointer) ; ULocaleData* in/out
(setting :int8)) ; CHAR
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $ulocdata_setNoSubstitute = Win32::API::More->new('icuin',
'void ulocdata_setNoSubstitute(LPVOID uld, char setting)');
# my $ret = $ulocdata_setNoSubstitute->Call($uld, $setting);
# uld : ULocaleData* in/out -> LPVOID
# setting : CHAR -> char
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。