bitable  0.1
Ordered immutable key value storage system.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
writablefile.h File Reference

Writable file IO support. More...

#include "bitablecommon.h"

Go to the source code of this file.

Typedefs

typedef struct BitableWritableFile BitableWritableFile
 

Functions

BITABLE_API BitableResult bitable_wf_create (BitableWritableFile **file, const char *path)
 
BITABLE_API BitableResult bitable_wf_seek (BitableWritableFile *file, int64_t position)
 
BITABLE_API BitableResult bitable_wf_write (BitableWritableFile *file, const void *data, uint32_t size)
 
BITABLE_API BitableResult bitable_wf_sync (BitableWritableFile *file)
 
BITABLE_API BitableResult bitable_wf_close (BitableWritableFile *file)
 

Detailed Description

Writable file IO support.

Typedef Documentation

OS specific structure for the handle information for a writable file.

Function Documentation

BITABLE_API BitableResult bitable_wf_close ( BitableWritableFile file)

Close a previously opened file.

Parameters
fileThe file to close. Does not null check.
Returns
A return code indicating either success, or the reason for failure.
BITABLE_API BitableResult bitable_wf_create ( BitableWritableFile **  file,
const char *  path 
)

Create a file for writing, allocating the handle information

Parameters
[out]fileAllocated open file handling for writing - should be closed with bitable_wf_close if this open function is successful. No null check performed.
pathThe file path to open, should be in UTF8 encoding. Does not null check.
Returns
A return code indicating either success, or the reason for failure.
BITABLE_API BitableResult bitable_wf_seek ( BitableWritableFile file,
int64_t  position 
)

Seek to a position in a previously opened file relative the beginning.

Parameters
fileThe file to seek in. Does not null check.
positionThe position to seek to.
Returns
A return code indicating either success, or the reason for failure.
BITABLE_API BitableResult bitable_wf_sync ( BitableWritableFile file)

Sync a file to disk, including its metadata.

Parameters
fileThe file to sync. Does not null check.
Returns
A return code indicating either success, or the reason for failure.
BITABLE_API BitableResult bitable_wf_write ( BitableWritableFile file,
const void *  data,
uint32_t  size 
)

Write data to the current file point for a file.

Parameters
fileThe file to write to. Does not null check.
dataThe data to write. Does not null check.
sizeThe amount of data to write in bytes.
Returns
A return code indicating either success, or the reason for failure.