6#define SF3_FORMAT_ID_TABLE 0x07
94 for(uint16_t i=0; i<column; ++i){
122 for(uint16_t i=0; i<column; ++i){
132 return column->
type & 0x0F;
138 return column->
length / (column->
type & 0x0F);
159 default:
return "Unknown";
166 const void *start = (
const void *)table;
#define SF3_SKIP_STR(STR)
Macro to retrieve a pointer past the variable size of an SF3 string.
SF3_INLINE const struct sf3_column_spec * sf3_table_next_column(const struct sf3_column_spec *column)
SF3_EXPORT const char * sf3_table_cell(const struct sf3_table *table, uint64_t row, uint64_t column, const struct sf3_column_spec **spec)
SF3_INLINE uint8_t sf3_table_element_size(const struct sf3_column_spec *column)
Returns the number of bytes per element of the given column.
SF3_INLINE const struct sf3_column_spec * sf3_table_column(const struct sf3_table *table, uint16_t column)
SF3_INLINE uint32_t sf3_table_element_count(const struct sf3_column_spec *column)
Returns the number of elements in a cell of the given column.
SF3_EXPORT const char * sf3_table_column_type(enum sf3_column_type type)
Returns a human-readable string description of the column type.
SF3_INLINE const char * sf3_table_row(const struct sf3_table *table, uint64_t row)
SF3_INLINE const char * sf3_table_data(const struct sf3_table *table)
Returns a pointer to the encoded table data.
sf3_column_type
The column value types that can be stored.
@ SF3_COLUMN_HIGH_RESOLUTION_TIMESTAMP
@ SF3_COLUMN_UINT16
The column elements are stored in 16-bit unsigned format.
@ SF3_COLUMN_INT8
The column elements are stored in 8-bit signed format.
@ SF3_COLUMN_INT64
The column elements are stored in 64-bit signed format.
@ SF3_COLUMN_UINT64
The column elements are stored in 64-bit unsigned format.
@ SF3_COLUMN_UINT32
The column elements are stored in 32-bit unsigned format.
@ SF3_COLUMN_STRING
The column element is a singular null-terminated string.
@ SF3_COLUMN_UINT8
The column elements are stored in 8-bit unsigned format.
@ SF3_COLUMN_INT16
The column elements are stored in 16-bit signed format.
@ SF3_COLUMN_INT32
The column elements are stored in 32-bit signed format.
SF3_EXPORT size_t sf3_table_size(const struct sf3_table *table)
Computes the size of the table file in bytes.
Description of a column within the table.
uint32_t length
The length of the column's values in bytes.
sf3_str16 name
The name of the column.
The basic header structure of every SF3 file.
uint32_t spec_length
The length of all the column specs in bytes.
uint64_t row_length
The length of each row in bytes.
uint64_t row_count
The number of rows in the table.
uint16_t column_count
The number of columns in the table.
struct sf3_column_spec columns[]
The column descriptions.