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

ulocdata_getNoSubstitute

関数
ロケールデータの代替不使用設定を取得する。
DLLicuin.dll呼出規約cdecl

シグネチャ

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

CHAR ulocdata_getNoSubstitute(
    ULocaleData* uld
);

パラメーター

名前方向説明
uldULocaleData*inout代替抑止設定を取得する対象のロケールデータオブジェクトのハンドル。

戻り値の型: CHAR

各言語での呼び出し定義

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

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

ulocdata_getNoSubstitute = ctypes.cdll.icuin.ulocdata_getNoSubstitute
ulocdata_getNoSubstitute.restype = ctypes.c_byte
ulocdata_getNoSubstitute.argtypes = [
    ctypes.c_void_p,  # uld : ULocaleData* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuin.dll')
ulocdata_getNoSubstitute = Fiddle::Function.new(
  lib['ulocdata_getNoSubstitute'],
  [
    Fiddle::TYPE_VOIDP,  # uld : ULocaleData* in/out
  ],
  Fiddle::TYPE_CHAR, Fiddle::Function::CDECL)
#[link(name = "icuin")]
extern "C" {
    fn ulocdata_getNoSubstitute(
        uld: *mut isize  // ULocaleData* in/out
    ) -> i8;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern sbyte ulocdata_getNoSubstitute(ref IntPtr uld);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_ulocdata_getNoSubstitute' -Namespace Win32 -PassThru
# $api::ulocdata_getNoSubstitute(uld)
#uselib "icuin.dll"
#func global ulocdata_getNoSubstitute "ulocdata_getNoSubstitute" sptr
; ulocdata_getNoSubstitute varptr(uld)   ; 戻り値は stat
; uld : ULocaleData* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "icuin.dll"
#cfunc global ulocdata_getNoSubstitute "ulocdata_getNoSubstitute" var
; res = ulocdata_getNoSubstitute(uld)
; uld : ULocaleData* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; CHAR ulocdata_getNoSubstitute(ULocaleData* uld)
#uselib "icuin.dll"
#cfunc global ulocdata_getNoSubstitute "ulocdata_getNoSubstitute" var
; res = ulocdata_getNoSubstitute(uld)
; uld : ULocaleData* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	proculocdata_getNoSubstitute = icuin.NewProc("ulocdata_getNoSubstitute")
)

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

extern "icuin" fn ulocdata_getNoSubstitute(
    uld: [*c]isize // ULocaleData* in/out
) callconv(.c) i8;
proc ulocdata_getNoSubstitute(
    uld: ptr int  # ULocaleData* in/out
): int8 {.importc: "ulocdata_getNoSubstitute", cdecl, dynlib: "icuin.dll".}
pragma(lib, "icuin");
extern(C)
byte ulocdata_getNoSubstitute(
    ptrdiff_t* uld   // ULocaleData* in/out
);
ccall((:ulocdata_getNoSubstitute, "icuin.dll"), Int8,
      (Ptr{Int},),
      uld)
# uld : ULocaleData* in/out -> Ptr{Int}
local ffi = require("ffi")
ffi.cdef[[
int8_t ulocdata_getNoSubstitute(
    intptr_t* uld);
]]
local icuin = ffi.load("icuin")
-- icuin.ulocdata_getNoSubstitute(uld)
-- uld : ULocaleData* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('icuin.dll');
const ulocdata_getNoSubstitute = lib.func('__cdecl', 'ulocdata_getNoSubstitute', 'int8_t', ['intptr_t *']);
// ulocdata_getNoSubstitute(uld)
// uld : ULocaleData* in/out -> 'intptr_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("icuin.dll", {
  ulocdata_getNoSubstitute: { parameters: ["pointer"], result: "i8" },
});
// lib.symbols.ulocdata_getNoSubstitute(uld)
// uld : ULocaleData* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int8_t ulocdata_getNoSubstitute(
    intptr_t* uld);
C, "icuin.dll");
// $ffi->ulocdata_getNoSubstitute(uld);
// uld : ULocaleData* in/out
// 構造体/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);
    byte ulocdata_getNoSubstitute(
        LongByReference uld   // ULocaleData* in/out
    );
}
@[Link("icuin")]
lib Libicuin
  fun ulocdata_getNoSubstitute = ulocdata_getNoSubstitute(
    uld : LibC::SSizeT*   # ULocaleData* in/out
  ) : Int8
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef ulocdata_getNoSubstituteNative = Int8 Function(Pointer<IntPtr>);
typedef ulocdata_getNoSubstituteDart = int Function(Pointer<IntPtr>);
final ulocdata_getNoSubstitute = DynamicLibrary.open('icuin.dll')
    .lookupFunction<ulocdata_getNoSubstituteNative, ulocdata_getNoSubstituteDart>('ulocdata_getNoSubstitute');
// uld : ULocaleData* in/out -> Pointer<IntPtr>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function ulocdata_getNoSubstitute(
  uld: Pointer   // ULocaleData* in/out
): Shortint; cdecl;
  external 'icuin.dll' name 'ulocdata_getNoSubstitute';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import ccall safe "ulocdata_getNoSubstitute"
  c_ulocdata_getNoSubstitute :: Ptr CIntPtr -> IO Int8
-- uld : ULocaleData* in/out -> Ptr CIntPtr
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let ulocdata_getnosubstitute =
  foreign "ulocdata_getNoSubstitute"
    ((ptr intptr_t) @-> returning int8_t)
(* uld : ULocaleData* in/out -> (ptr intptr_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library icuin (t "icuin.dll"))
(cffi:use-foreign-library icuin)

(cffi:defcfun ("ulocdata_getNoSubstitute" ulocdata-get-no-substitute :convention :cdecl) :int8
  (uld :pointer))   ; ULocaleData* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $ulocdata_getNoSubstitute = Win32::API::More->new('icuin',
    'char ulocdata_getNoSubstitute(LPVOID uld)');
# my $ret = $ulocdata_getNoSubstitute->Call($uld);
# uld : ULocaleData* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。