Main Page   Compound List   File List   Compound Members   File Members  

lib/view.c File Reference

View implementation. More...

#include "gobj/view.h"
#include "gobj/lang.h"
#include "gobj/errors.h"

Functions

Gj_ViewGj_view_new (Gj_Ctx* ctx, char* name, Gj_Id* id, Gj_Id* type, Gj_Path* nativefunc)
 Create a new view structure. More...

Gj_ViewGj_view_create (Gj_Ctx* ctx, Gj_Stream* stream)
 Create a view form a stream. More...

int Gj_view_delete (Gj_Ctx* ctx, Gj_View* ptr)
 Delete a view structure. More...

int Gj_view_write (Gj_Ctx* ctx, Gj_View* view, Gj_Stream* stream)
 Write a view to a stream. More...

void Gj_view_register (Gj_Ctx* ctx, Gj_View* view)
 Register a view. More...

void Gj_view_finish (Gj_Ctx* ctx, Gj_View* view)
 Finish a view. More...

Gj_Bool Gj_view_isRegistered (Gj_View* view)
 Checks whether a view has been registered.

Gj_Bool Gj_view_isFinished (Gj_View* view)
 Checks whether a view has been finished.

char* Gj_view_getName (Gj_View* view)
 Get the name of the view. More...

Gj_IdGj_view_getId (Gj_Ctx* ctx, Gj_View* view)
 Get the id of a view. More...

int Gj_view_addParameter (Gj_Ctx* ctx, Gj_View* view, char* name, Gj_Id* type)
 Add a parameter. More...

int Gj_view_getParameterCount (Gj_View* view)
 Get the parameter count.

int Gj_view_getParameterNumber (Gj_Ctx* ctx, Gj_View* view, char* name)
 Get the number of a parameter given by its name. More...

int Gj_view_setDefinition (Gj_Ctx* ctx, Gj_View* view, Gj_Object* def)
 Set the definition of the view. More...

Gj_IdGj_view_getType (Gj_View* view)
 Get the return type of the view. More...


Detailed Description

View implementation.


Function Documentation

Gj_View * Gj_view_new ( Gj_Ctx * ctx,
char * name,
Gj_Id * id,
Gj_Id * type,
Gj_Path * nativefunc )
 

Create a new view structure.

Name may be 0. Id may be 0, in this case a new id is assigned. Nativefunc may be 0. Nativefunc will not be NOT DUPLICATED, the view will overtake the OWNERSHIP of the path.

Returns:
The pointer to the structure on success, 0 otherwise.

Gj_View * Gj_view_create ( Gj_Ctx * ctx,
Gj_Stream * stream )
 

Create a view form a stream.

Returns:
The pointer to the view on success, 0 otherwise.

int Gj_view_delete ( Gj_Ctx * ctx,
Gj_View * ptr )
 

Delete a view structure.

Returns:
0 on success, -1 otherwise.

int Gj_view_write ( Gj_Ctx * ctx,
Gj_View * view,
Gj_Stream * stream )
 

Write a view to a stream.

Returns:
0 on success, -1 otherwise.

void Gj_view_register ( Gj_Ctx * ctx,
Gj_View * view )
 

Register a view.

A locally unique id is assigned if no other set.

void Gj_view_finish ( Gj_Ctx * ctx,
Gj_View * view )
 

Finish a view.

The/a global unique id is assigned. The view cannot be changed anymore.

char * Gj_view_getName ( Gj_View * view )
 

Get the name of the view.

Return value 0 means no name is set.

Gj_Id * Gj_view_getId ( Gj_Ctx * ctx,
Gj_View * view )
 

Get the id of a view.

The id is STILL OWNED by the view.

Returns:
The pointer to the id on success, 0 otherwise.

int Gj_view_addParameter ( Gj_Ctx * ctx,
Gj_View * view,
char * name,
Gj_Id * type )
 

Add a parameter.

Returns:
0 on success, -1 otherwise.

int Gj_view_getParameterNumber ( Gj_Ctx * ctx,
Gj_View * view,
char * name )
 

Get the number of a parameter given by its name.

Returns:
The number of the parameter on success, -1 otherwise.

int Gj_view_setDefinition ( Gj_Ctx * ctx,
Gj_View * view,
Gj_Object * def )
 

Set the definition of the view.

This functions should be called AFTER all needed calls to Gj_view_addParameter() were made. The object is NOT duplicated.

Returns:
0 on success, -1 otherwise.

Gj_Id * Gj_view_getType ( Gj_View * view )
 

Get the return type of the view.

The returned id is STILL OWNED by the view.


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