GATE
C/C++ Framework
Loading...
Searching...
No Matches
storagedrives.h File Reference

physical storage drive info and access utilities More...

Macros

#define GATE_STORAGEDRIVE_TYPE_ALL   0x0000
#define GATE_STORAGEDRIVE_TYPE_STANDARD   0x0001
#define GATE_STORAGEDRIVE_TYPE_ROM   0x0002
#define GATE_STORAGEDRIVE_TYPE_REMOVABLE   0x0004
#define GATE_STORAGEDRIVE_TYPE_VIRTUAL   0x0008
#define GATE_STORAGEDRIVE_ATTRIBTYPE_SMART   (0x0100)
#define GATE_STORAGEDRIVE_ATTRIBINDEX_SMART_ID   0
#define GATE_STORAGEDRIVE_ATTRIBINDEX_SMART_VALUE   1
#define GATE_STORAGEDRIVE_ATTRIBINDEX_SMART_WORST   2
#define GATE_STORAGEDRIVE_ATTRIBINDEX_SMART_RAW   3
#define GATE_STORAGEDRIVE_ATTRIBINDEX_SMART_THRESHOLD   4
#define GATE_STORAGEDRIVE_ATTRIBINDEX_SMART_DIRECTION   5

Typedefs

typedef gate_bool_t(* gate_storagedrive_attribs_callback_t) (gate_storagedrive_t const *drive, gate_enumint_t attrib_type, gate_int64_t const *values, gate_size_t values_count, char const *const *texts, gate_size_t texts_count, void *user_param)
 Callback function type used by gate_storagedrive_queryattribs

Functions

GATE_SYSTEM_API gate_result_t gate_storagedrive_enum (gate_enumint_t drivetype, gate_storagedrive_enum_callback_t callback, void *user_param)
 List all detected storage drives and invokes a callback for each drive.
GATE_SYSTEM_API gate_result_t gate_storagedrive_openstream (gate_storagedrive_t const *drive, gate_enumint_t open_flags, gate_controlstream_t **stream)
 Open a specified storage drive for direct data access.
GATE_SYSTEM_API gate_result_t gate_storagedrive_find (gate_string_t const *field, gate_uint32_t field_type, gate_storagedrive_t *drive)
 Find a storage drive by a specified identifier.
GATE_SYSTEM_API gate_result_t gate_storagedrive_queryattribs (gate_storagedrive_t const *drive, gate_enumint_t attrib_type, gate_storagedrive_attribs_callback_t callback, void *user_param)
 Retrieve advanced attributes from a storage drive.

Detailed Description

physical storage drive info and access utilities

Macro Definition Documentation

◆ GATE_STORAGEDRIVE_TYPE_ALL

#define GATE_STORAGEDRIVE_TYPE_ALL   0x0000

for enum only: return all types

◆ GATE_STORAGEDRIVE_TYPE_STANDARD

#define GATE_STORAGEDRIVE_TYPE_STANDARD   0x0001

Standard drive, hard disk, flash drive

◆ GATE_STORAGEDRIVE_TYPE_ROM

#define GATE_STORAGEDRIVE_TYPE_ROM   0x0002

Read-Only drive, CD-ROM, DVD-ROM, BluRay

◆ GATE_STORAGEDRIVE_TYPE_REMOVABLE

#define GATE_STORAGEDRIVE_TYPE_REMOVABLE   0x0004

Removable storage: Floppy, flash drives, MMC

◆ GATE_STORAGEDRIVE_TYPE_VIRTUAL

#define GATE_STORAGEDRIVE_TYPE_VIRTUAL   0x0008

Virtual storage: RAM-disk, emulation

◆ GATE_STORAGEDRIVE_ATTRIBTYPE_SMART

#define GATE_STORAGEDRIVE_ATTRIBTYPE_SMART   (0x0100)

query disk SMART status values

◆ GATE_STORAGEDRIVE_ATTRIBINDEX_SMART_ID

#define GATE_STORAGEDRIVE_ATTRIBINDEX_SMART_ID   0

SMART ID field

◆ GATE_STORAGEDRIVE_ATTRIBINDEX_SMART_VALUE

#define GATE_STORAGEDRIVE_ATTRIBINDEX_SMART_VALUE   1

SMART current value field

◆ GATE_STORAGEDRIVE_ATTRIBINDEX_SMART_WORST

#define GATE_STORAGEDRIVE_ATTRIBINDEX_SMART_WORST   2

SMART worst value field

◆ GATE_STORAGEDRIVE_ATTRIBINDEX_SMART_RAW

#define GATE_STORAGEDRIVE_ATTRIBINDEX_SMART_RAW   3

SMART raw value field

◆ GATE_STORAGEDRIVE_ATTRIBINDEX_SMART_THRESHOLD

#define GATE_STORAGEDRIVE_ATTRIBINDEX_SMART_THRESHOLD   4

SMART threshold value field

◆ GATE_STORAGEDRIVE_ATTRIBINDEX_SMART_DIRECTION

#define GATE_STORAGEDRIVE_ATTRIBINDEX_SMART_DIRECTION   5

SMART direction value field

Function Documentation

◆ gate_storagedrive_enum()

GATE_SYSTEM_API gate_result_t gate_storagedrive_enum ( gate_enumint_t drivetype,
gate_storagedrive_enum_callback_t callback,
void * user_param )

List all detected storage drives and invokes a callback for each drive.

Parameters
[in]drivetypeGATE_STORAGEDRIVE_TYPE_* value to filter for specific drive types
[in]callbackCallback function to be called for each detected drive
[in]user_paramUser parameter to be attached to each callback call
Returns
GATE_RESULT_* result code

◆ gate_storagedrive_openstream()

GATE_SYSTEM_API gate_result_t gate_storagedrive_openstream ( gate_storagedrive_t const * drive,
gate_enumint_t open_flags,
gate_controlstream_t ** stream )

Open a specified storage drive for direct data access.

Parameters
[in]drivePointer to storage drive info object to be opened
[in]open_flagsGATE_STREAM_OPEN_* flag to indicate read or write access
[out]streamPointer to interface-pointer to be initialized with new created stream object return GATE_RESULT_* result code

◆ gate_storagedrive_find()

GATE_SYSTEM_API gate_result_t gate_storagedrive_find ( gate_string_t const * field,
gate_uint32_t field_type,
gate_storagedrive_t * drive )

Find a storage drive by a specified identifier.

Parameters
[in]fieldString to identify the requested storage drive
[in]field_typeGATE_STORAGEDRIVE_* value to specify which field is used for identification
[out]drivePointer to drive object to be initialized with data from found storage drive return GATE_RESULT_* result code

◆ gate_storagedrive_queryattribs()

GATE_SYSTEM_API gate_result_t gate_storagedrive_queryattribs ( gate_storagedrive_t const * drive,
gate_enumint_t attrib_type,
gate_storagedrive_attribs_callback_t callback,
void * user_param )

Retrieve advanced attributes from a storage drive.

Parameters
[in]drivePointer to drive object identifying the storage drive
[in]attrib_typeGATE_STORAGEDRIVE_ATTRIBTYPE_* value to describe the requested attribute type
[in]callbackCallback function to be called for each found attribute value
[in]user_paramUser parameter to be attached to each callback call
Returns
GATE_RESULT_* result code