JULEA
Data Structures | Typedefs | Functions
Item

Data Structures

struct  JItemGetData
 
struct  JItem
 

Typedefs

typedef struct JItem JItem
 
typedef struct JItemGetData JItemGetData
 

Functions

G_GNUC_INTERNAL void j_item_set_modification_time (JItem *item, gint64 modification_time)
 
G_GNUC_INTERNAL void j_item_set_size (JItem *item, guint64 size)
 
G_END_DECLS G_BEGIN_DECLS JItemj_item_ref (JItem *item)
 
void j_item_unref (JItem *item)
 
gchar const * j_item_get_name (JItem *item)
 
JItemj_item_create (JCollection *collection, gchar const *name, JDistribution *distribution, JBatch *batch)
 
void j_item_delete (JItem *item, JBatch *batch)
 
void j_item_get (JCollection *collection, JItem **item, gchar const *name, JBatch *batch)
 
void j_item_read (JItem *item, gpointer data, guint64 length, guint64 offset, guint64 *bytes_read, JBatch *batch)
 
void j_item_write (JItem *item, gconstpointer data, guint64 length, guint64 offset, guint64 *bytes_written, JBatch *batch)
 
void j_item_get_status (JItem *item, JBatch *batch)
 
guint64 j_item_get_size (JItem *item)
 
gint64 j_item_get_modification_time (JItem *item)
 

Detailed Description

Data structures and functions for managing items.

Typedef Documentation

◆ JItem

typedef struct JItem JItem

◆ JItemGetData

typedef struct JItemGetData JItemGetData

Function Documentation

◆ j_item_create()

JItem * j_item_create ( JCollection collection,
gchar const *  name,
JDistribution distribution,
JBatch batch 
)

Creates an item in a collection.

Parameters
collectionA collection.
nameA name.
distributionA distribution.
batchA batch.
Returns
A new item. Should be freed with j_item_unref().

◆ j_item_delete()

void j_item_delete ( JItem item,
JBatch batch 
)

Deletes an item from a collection.

Parameters
itemAn item.
batchA batch.

◆ j_item_get()

void j_item_get ( JCollection collection,
JItem **  item,
gchar const *  name,
JBatch batch 
)

Gets an item from a collection.

Parameters
collectionA collection.
itemA pointer to an item.
nameA name.
batchA batch.

◆ j_item_get_modification_time()

gint64 j_item_get_modification_time ( JItem item)

Returns an item's modification time.

Parameters
itemAn item.
Returns
A modification time.

◆ j_item_get_name()

gchar const * j_item_get_name ( JItem item)

Returns an item's name.

Parameters
itemAn item.
Returns
The name.

◆ j_item_get_size()

guint64 j_item_get_size ( JItem item)

Returns an item's size.

Parameters
itemAn item.
Returns
A size.

◆ j_item_get_status()

void j_item_get_status ( JItem item,
JBatch batch 
)

Get the status of an item.

Parameters
itemAn item.
batchA batch.
Todo:
check j_item_get_status_exec

◆ j_item_read()

void j_item_read ( JItem item,
gpointer  data,
guint64  length,
guint64  offset,
guint64 *  bytes_read,
JBatch batch 
)

Reads an item.

Parameters
itemAn item.
dataA buffer to hold the read data.
lengthNumber of bytes to read.
offsetAn offset within item.
bytes_readNumber of bytes read.
batchA batch.

◆ j_item_ref()

JItem * j_item_ref ( JItem item)

Increases an item's reference count.

JItem* i;
G_END_DECLS G_BEGIN_DECLS JItem * j_item_ref(JItem *item)
Definition: jitem.c:108
Definition: jitem.c:59
Parameters
itemAn item.
Returns
item.

◆ j_item_set_modification_time()

void j_item_set_modification_time ( JItem item,
gint64  modification_time 
)

Sets an item's modification time.

Parameters
itemAn item.
modification_timeA modification time.

◆ j_item_set_size()

void j_item_set_size ( JItem item,
guint64  size 
)

Sets an item's size.

Parameters
itemAn item.
sizeA size.

◆ j_item_unref()

void j_item_unref ( JItem item)

Decreases an item's reference count. When the reference count reaches zero, frees the memory allocated for the item.

Parameters
itemAn item.

◆ j_item_write()

void j_item_write ( JItem item,
gconstpointer  data,
guint64  length,
guint64  offset,
guint64 *  bytes_written,
JBatch batch 
)

Writes an item.

Note
j_item_write() modifies bytes_written even if j_batch_execute() is not called.
Parameters
itemAn item.
dataA buffer holding the data to write.
lengthNumber of bytes to write.
offsetAn offset within item.
bytes_writtenNumber of bytes written.
batchA batch.
Todo:
see j_item_write_exec