ホーム › Storage.FileSystem › TAPE_SET_POSITION
TAPE_SET_POSITION
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Method | TAPE_POSITION_METHOD | 4 | +0 | +0 | 位置決め方法(相対/絶対/末尾等のTAPE_POSITION_METHOD)。 |
| Partition | DWORD | 4 | +4 | +4 | 対象テープパーティションの番号。 |
| Offset | LONGLONG | 8 | +8 | +8 | 移動先の位置オフセット。 |
| Immediate | BOOLEAN | 1 | +16 | +16 | TRUEなら完了を待たず即座に制御を返す。 |
各言語での定義
#include <windows.h>
// TAPE_SET_POSITION (x64 24 / x86 24 バイト)
typedef struct TAPE_SET_POSITION {
TAPE_POSITION_METHOD Method;
DWORD Partition;
LONGLONG Offset;
BOOLEAN Immediate;
} TAPE_SET_POSITION;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TAPE_SET_POSITION
{
public uint Method;
public uint Partition;
public long Offset;
[MarshalAs(UnmanagedType.U1)] public bool Immediate;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TAPE_SET_POSITION
Public Method As UInteger
Public Partition As UInteger
Public Offset As Long
<MarshalAs(UnmanagedType.U1)> Public Immediate As Boolean
End Structureimport ctypes
from ctypes import wintypes
class TAPE_SET_POSITION(ctypes.Structure):
_fields_ = [
("Method", wintypes.DWORD),
("Partition", wintypes.DWORD),
("Offset", ctypes.c_longlong),
("Immediate", ctypes.c_byte),
]#[repr(C)]
pub struct TAPE_SET_POSITION {
pub Method: u32,
pub Partition: u32,
pub Offset: i64,
pub Immediate: u8,
}import "golang.org/x/sys/windows"
type TAPE_SET_POSITION struct {
Method uint32
Partition uint32
Offset int64
Immediate byte
}type
TAPE_SET_POSITION = record
Method: DWORD;
Partition: DWORD;
Offset: Int64;
Immediate: ByteBool;
end;const TAPE_SET_POSITION = extern struct {
Method: u32,
Partition: u32,
Offset: i64,
Immediate: u8,
};type
TAPE_SET_POSITION {.bycopy.} = object
Method: uint32
Partition: uint32
Offset: int64
Immediate: uint8struct TAPE_SET_POSITION
{
uint Method;
uint Partition;
long Offset;
ubyte Immediate;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; TAPE_SET_POSITION サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; Method : TAPE_POSITION_METHOD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Partition : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Offset : LONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; Immediate : BOOLEAN (+16, 1byte) poke st,16,値 / 値 = peek(st,16)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global TAPE_SET_POSITION
#field int Method
#field int Partition
#field int64 Offset
#field bool1 Immediate
#endstruct
stdim st, TAPE_SET_POSITION ; NSTRUCT 変数を確保
st->Method = 100
mes "Method=" + st->Method