Main Page   Compound List   File List   Compound Members   File Members  

lib/gobj/container.h File Reference

Container object header. More...

#include <gobjconfig.h>
#include <gobj/decls.h>
#include <gobj/context.h>
#include <gobj/stream.h>

Defines

#define Gj_containerId_read(ctx, id, stream)    (Gj_stream_readInt((ctx), (stream), (id)))
 Read a container id from a stream. More...

#define Gj_containerId_write(ctx, id, stream)    (Gj_stream_writeInt((ctx), (stream), (id)))
 Write a container id to a stream. More...


Functions

Gj_ContainerGj_container_new (Gj_Ctx* ctx, Gj_Id* id)
 Create a new container. More...

Gj_ContainerGj_container_create (Gj_Ctx* ctx, Gj_Stream* stream)
 Create a container from a stream. More...

Gj_ContainerGj_container_open (Gj_Ctx* ctx, Gj_Id* id, char* name)
 Open the container specified by its id or its name. More...

int Gj_container_delete (Gj_Ctx* ctx, Gj_Container* container)
 Delete the given container. More...

int Gj_container_destroy (Gj_Ctx* ctx, Gj_Container* container)
 Destroy the given container PHYSICALLY. More...

int Gj_container_write (Gj_Ctx* ctx, Gj_Container* container, Gj_Stream* stream)
 Write the given container to a stream. More...

int Gj_container_setName (Gj_Ctx* ctx, Gj_Container* container, char* name)
 Set the name of the container. More...

Gj_IdGj_container_getId (Gj_Ctx* ctx, Gj_Container* container)
 Get the id of the container. More...

Gj_ContainerId Gj_container_getNewId (Gj_Ctx* ctx, Gj_Container* container)
 Get a new container id. More...

int Gj_container_releaseId (Gj_Ctx* ctx, Gj_Container* container, Gj_ContainerId id)
 Release a container id and thus destroy the data linked with it. More...

int Gj_container_clear (Gj_Ctx* ctx, Gj_Container* container)
 Clear the container (i.e. delete all data saved in it). More...

Gj_StreamGj_container_getStream (Gj_Ctx* ctx, Gj_Container* container, Gj_ContainerId id)
 Ask for a stream to do I/O on a given container id. More...

int Gj_container_releaseStream (Gj_Ctx* ctx, Gj_Container* container, Gj_ContainerId id, Gj_Stream* stream)
 Release a used stream. More...


Detailed Description

Container object header.


Define Documentation

#define Gj_containerId_read( ctx, id, stream )   (Gj_stream_readInt((ctx), (stream), (id)))
 

Read a container id from a stream.

Returns:
0 on success, -1 otherwise.

#define Gj_containerId_write( ctx, id, stream )   (Gj_stream_writeInt((ctx), (stream), (id)))
 

Write a container id to a stream.

Returns:
0 on success, -1 otherwise.


Function Documentation

Gj_Container * Gj_container_new ( Gj_Ctx * ctx,
Gj_Id * id )
 

Create a new container.

If

(id != 0) 
use the given id as the container id, else create a new id.

Returns:
A pointer to the new container on success, 0 otherwise.

Gj_Container * Gj_container_create ( Gj_Ctx * ctx,
Gj_Stream * stream )
 

Create a container from a stream.

Returns:
A pointer to the new container on success, 0 otherwise.

Gj_Container * Gj_container_open ( Gj_Ctx * ctx,
Gj_Id * id,
char * name )
 

Open the container specified by its id or its name.

Returns:
A pointer to the container on success, 0 otherwise.

int Gj_container_delete ( Gj_Ctx * ctx,
Gj_Container * container )
 

Delete the given container.

The container is NOT PHYSICALLY deleted.

Returns:
0 on success, -1 otherwise.

int Gj_container_destroy ( Gj_Ctx * ctx,
Gj_Container * container )
 

Destroy the given container PHYSICALLY.

Returns:
0 on success, -1 otherwise.

int Gj_container_write ( Gj_Ctx * ctx,
Gj_Container * container,
Gj_Stream * stream )
 

Write the given container to a stream.

Returns:
0 on success, -1 otherwise.

int Gj_container_setName ( Gj_Ctx * ctx,
Gj_Container * container,
char * name )
 

Set the name of the container.

The string is BEING DUPLICATED.

Returns:
0 on success, -1 otherwise.

Gj_Id * Gj_container_getId ( Gj_Ctx * ctx,
Gj_Container * container )
 

Get the id of the container.

The id is STILL OWNED by the container.

Gj_ContainerId Gj_container_getNewId ( Gj_Ctx * ctx,
Gj_Container * container )
 

Get a new container id.

Returns:
the container id on success, 0 otherwise.

int Gj_container_releaseId ( Gj_Ctx * ctx,
Gj_Container * container,
Gj_ContainerId id )
 

Release a container id and thus destroy the data linked with it.

Returns:
0 on success, -1 otherwise.

int Gj_container_clear ( Gj_Ctx * ctx,
Gj_Container * container )
 

Clear the container (i.e. delete all data saved in it).

Returns:
0 on success, -1 otherwise.

Gj_Stream * Gj_container_getStream ( Gj_Ctx * ctx,
Gj_Container * container,
Gj_ContainerId id )
 

Ask for a stream to do I/O on a given container id.

Returns:
A pointer to the stream on success, 0 otherwise.

int Gj_container_releaseStream ( Gj_Ctx * ctx,
Gj_Container * container,
Gj_ContainerId id,
Gj_Stream * stream )
 

Release a used stream.

Returns:
0 on success, -1 otherwise.


Generated at Fri Aug 17 18:28:56 2001 for Gobj by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000