ホーム › Networking.WinInet › GOPHER_ATTRIBUTE_TYPE
GOPHER_ATTRIBUTE_TYPE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| CategoryId | DWORD | 4 | +0 | +0 | 属性が属するカテゴリのID。属性の分類を識別する。 |
| AttributeId | DWORD | 4 | +4 | +4 | 属性の種別を識別するID。後続の共用体メンバーを判別する。 |
| AttributeType | _AttributeType_e__Union | 24 | +8 | +8 | 属性値を保持する無名共用体。AttributeIdに応じた具体的属性構造体を格納する。 |
共用体: _AttributeType_e__Union x64 24B / x86 24B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| Admin | GOPHER_ADMIN_ATTRIBUTE_TYPE | 16/8 | +0 | +0 |
| ModDate | GOPHER_MOD_DATE_ATTRIBUTE_TYPE | 8 | +0 | +0 |
| Ttl | GOPHER_TTL_ATTRIBUTE_TYPE | 4 | +0 | +0 |
| Score | GOPHER_SCORE_ATTRIBUTE_TYPE | 4 | +0 | +0 |
| ScoreRange | GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE | 8 | +0 | +0 |
| Site | GOPHER_SITE_ATTRIBUTE_TYPE | 8/4 | +0 | +0 |
| Organization | GOPHER_ORGANIZATION_ATTRIBUTE_TYPE | 8/4 | +0 | +0 |
| Location | GOPHER_LOCATION_ATTRIBUTE_TYPE | 8/4 | +0 | +0 |
| GeographicalLocation | GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE | 24 | +0 | +0 |
| TimeZone | GOPHER_TIMEZONE_ATTRIBUTE_TYPE | 4 | +0 | +0 |
| Provider | GOPHER_PROVIDER_ATTRIBUTE_TYPE | 8/4 | +0 | +0 |
| Version | GOPHER_VERSION_ATTRIBUTE_TYPE | 8/4 | +0 | +0 |
| Abstract | GOPHER_ABSTRACT_ATTRIBUTE_TYPE | 16/8 | +0 | +0 |
| View | GOPHER_VIEW_ATTRIBUTE_TYPE | 24/12 | +0 | +0 |
| Veronica | GOPHER_VERONICA_ATTRIBUTE_TYPE | 4 | +0 | +0 |
| Ask | GOPHER_ASK_ATTRIBUTE_TYPE | 16/8 | +0 | +0 |
| Unknown | GOPHER_UNKNOWN_ATTRIBUTE_TYPE | 8/4 | +0 | +0 |
各言語での定義
#include <windows.h>
// GOPHER_ATTRIBUTE_TYPE (x64 32 / x86 32 バイト)
typedef struct GOPHER_ATTRIBUTE_TYPE {
DWORD CategoryId;
DWORD AttributeId;
_AttributeType_e__Union AttributeType;
} GOPHER_ATTRIBUTE_TYPE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GOPHER_ATTRIBUTE_TYPE
{
public uint CategoryId;
public uint AttributeId;
public _AttributeType_e__Union AttributeType;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GOPHER_ATTRIBUTE_TYPE
Public CategoryId As UInteger
Public AttributeId As UInteger
Public AttributeType As _AttributeType_e__Union
End Structureimport ctypes
from ctypes import wintypes
class GOPHER_ATTRIBUTE_TYPE(ctypes.Structure):
_fields_ = [
("CategoryId", wintypes.DWORD),
("AttributeId", wintypes.DWORD),
("AttributeType", _AttributeType_e__Union),
]#[repr(C)]
pub struct GOPHER_ATTRIBUTE_TYPE {
pub CategoryId: u32,
pub AttributeId: u32,
pub AttributeType: _AttributeType_e__Union,
}import "golang.org/x/sys/windows"
type GOPHER_ATTRIBUTE_TYPE struct {
CategoryId uint32
AttributeId uint32
AttributeType _AttributeType_e__Union
}type
GOPHER_ATTRIBUTE_TYPE = record
CategoryId: DWORD;
AttributeId: DWORD;
AttributeType: _AttributeType_e__Union;
end;const GOPHER_ATTRIBUTE_TYPE = extern struct {
CategoryId: u32,
AttributeId: u32,
AttributeType: _AttributeType_e__Union,
};type
GOPHER_ATTRIBUTE_TYPE {.bycopy.} = object
CategoryId: uint32
AttributeId: uint32
AttributeType: _AttributeType_e__Unionstruct GOPHER_ATTRIBUTE_TYPE
{
uint CategoryId;
uint AttributeId;
_AttributeType_e__Union AttributeType;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GOPHER_ATTRIBUTE_TYPE サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; CategoryId : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; AttributeId : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; AttributeType : _AttributeType_e__Union (+8, 24byte) varptr(st)+8 を基点に操作(24byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GOPHER_ATTRIBUTE_TYPE
#field int CategoryId
#field int AttributeId
#field byte AttributeType 24
#endstruct
stdim st, GOPHER_ATTRIBUTE_TYPE ; NSTRUCT 変数を確保
st->CategoryId = 100
mes "CategoryId=" + st->CategoryId
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。