Wheefun I/O Library  0.0.5
Useful I/O Primitives.
Classes | Namespaces | Typedefs | Enumerations | Variables
iotype.h File Reference

I/O type declarations. More...

#include <stddef.h>

Go to the source code of this file.

Classes

struct  wfio::IOShare
 An IO sharing mode. More...
 
struct  wfio::DCntl
 A command to be supplied to a device or similar stream. More...
 

Namespaces

 wfio
 The root namespace for WFIO.
 

Typedefs

typedef enum wfio_whence_t wfio_whence_t
 The type corresponding to the point of reference in a seek operation.
 
typedef enum wfio_openflag_t wfio_openflag_t
 A single flag for a wfio_openmode_t;.
 
typedef int wfio_openmode_t
 The type corresponding to an openmode.
 
typedef int wfio_fd_t
 The type corresponding a file descriptor.
 
typedef enum wfio_peer_type_t wfio_peer_type_t
 The type associated with a peer.
 
typedef int wfio_ioshare_t
 An I/O sharing mode.
 
typedef ::wfio_off_t wfio::off_t
 An integer corresponding to a device offset. More...
 
typedef ::wfio_fd_t wfio::fd_t
 The type corresponding a file descriptor. More...
 

Enumerations

enum  wfio_whence_t { WFIO_SEEK_SET, WFIO_SEEK_CUR, WFIO_SEEK_END }
 The type corresponding to the point of reference in a seek operation. More...
 
enum  wfio_openflag_t {
  WFIO_OPEN_READ = 0x1, WFIO_OPEN_WRITE = 0x2, WFIO_OPEN_APPEND = 0x4, WFIO_OPEN_CREATE = 0x8,
  WFIO_OPEN_TRUNCATE = 0x10, WFIO_OPEN_NONBLOCK = 0x30, WFIO_OPEN_NOTEXIST = 0x40, WFIO_OPEN_EXCL = WFIO_OPEN_NOTEXIST,
  WFIO_OPEN_RW = WFIO_OPEN_READ | WFIO_OPEN_WRITE
}
 A single flag for a wfio_openmode_t;. More...
 
enum  { WFIO_BAD_FD = -1 }
 
enum  wfio_peer_type_t { WFIO_PEER_UNKNOWN, WFIO_PEER_DEVICE, WFIO_PEER_BINSTREAM }
 The type associated with a peer. More...
 
enum  { WFIO_IOSHARE_O_WEAK = 0x0, WFIO_IOSHARE_O_ACQUIRE = 0x1, WFIO_IOSHARE_O_DUP = 0x2, WFIO_IOSHARE_M_OWNERSHIP = 0x3 }
 
enum  wfio_dcntl_t {
  WFIO_DCNTL_NOP, WFIO_DCNTL_GETFD, WFIO_DCNTL_SETFLAGS, WFIO_DCNTL_GETFLAGS,
  WFIO_DCNTL_TRUNCATE
}
 A command to be supplied to a device or similar stream. More...
 
enum  { WFIO_NPOS = (size_t) -1 }
 
enum  { wfio::NPOS = ::WFIO_NPOS }
 

Variables

WFIO_C_BEGIN typedef long int wfio_off_t
 An integer corresponding to a device offset.
 

Detailed Description

I/O type declarations.

This header declares basic I/O types.

Author
Phillip Kilgore
Since
0.0.1

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
WFIO_IOSHARE_O_WEAK 

An IOShare mode indicating that the stream is shared weakly.

WFIO_IOSHARE_O_ACQUIRE 

An IOShare mode indicating that the stream is acquired.

WFIO_IOSHARE_O_DUP 

An IOShare mode indicating that the stream is duplicated.

WFIO_IOSHARE_M_OWNERSHIP 

An IOShare mask selecting the ownership mode for this mode.

◆ anonymous enum

anonymous enum
Enumerator
WFIO_NPOS 

A constant indicating no position.

◆ anonymous enum

anonymous enum
Enumerator
WFIO_BAD_FD 

A constant representing a bad file descriptor.

◆ wfio_dcntl_t

A command to be supplied to a device or similar stream.

These commands provide device-independent control of a stream. This is used to implement commands which can be shared between multiple devices.

Enumerator
WFIO_DCNTL_NOP 

Perform no operation.

This command takes no arguments and does nothing. If dcntl is supported, this command returns nonzero; otherwise, it returns zero and possibly sets the stream's error code.

WFIO_DCNTL_GETFD 

Obtain the file's current file descriptor.

Some devices are backed by a file descriptor backed by the operating system. When operating systemds support

Parameters
fdAn int* to hold the file descriptor.
WFIO_DCNTL_SETFLAGS 

Attempt to change the flags associated with this device.

Parameters
WFIO_DCNTL_GETFLAGS 

Obtain the flags associated with this device.

WFIO_DCNTL_TRUNCATE 

Set the length of a device's backing store.

Some devices are backed by some form of persistent storage (such as a file) which admits being resized. When supported, this command shall attempt to resize the backing store to the length specified in the first argument (sz), which shall be of type size_t.

Parameters
szA size_t specifying the desired length of backing store.

◆ wfio_openflag_t

A single flag for a wfio_openmode_t;.

Enumerator
WFIO_OPEN_READ 

The stream should be readable.

WFIO_OPEN_WRITE 

The stream should be writable.

WFIO_OPEN_APPEND 

The stream should allow files to be appended.

WFIO_OPEN_CREATE 

The stream should be created if it doesn't exist.

WFIO_OPEN_TRUNCATE 

The stream should truncate on open.

WFIO_OPEN_NONBLOCK 

The stream should be non-blocking.

WFIO_OPEN_NOTEXIST 

The stream should point to a resource that does not yet exist.

WFIO_OPEN_EXCL 

Synonymous with WFIO_OPEN_NOTEXIST

WFIO_OPEN_RW 

The stream is both readable and writable.

This is synonymous with WFIO_OPEN_READ | WFIO_OPEN_WRITE.

◆ wfio_peer_type_t

The type associated with a peer.

Enumerator
WFIO_PEER_UNKNOWN 

The peer type is unknown.

WFIO_PEER_DEVICE 

The peer type is a device.

WFIO_PEER_BINSTREAM 

The peer type is a binstream.

◆ wfio_whence_t

The type corresponding to the point of reference in a seek operation.

Enumerator
WFIO_SEEK_SET 

The seek operation is relative to the beginning of the stream.

WFIO_SEEK_CUR 

The seek operation is relative to the current position in the stream.

WFIO_SEEK_END 

The seek operation is relative to the end of the stream.