Main Page   File List   File Members  

value.h File Reference

#include <gtk/gtk.h>

Go to the source code of this file.

Compounds

struct  s_value

Defines

#define VALUE_TYPE(class)   ((CLASS(class))->value.valuetype)
#define VALUE_VALUE(class, type)

Enumerations

enum  valuetype_t {
  T_ILLEGAL, T_NONE, T_INT, T_FLOAT,
  T_BOOL, T_STRING
}

Functions

void value_set (struct s_value *, valuetype_t,...)
void value_unset (struct s_value)
void value_translate (struct s_value, struct s_value)


Detailed Description

Author:
Guillaume Bour. 2002
Version:
0.1
Date:
28/02/2002
Values definition


Define Documentation

#define VALUE_VALUE class,
type   
 

Value:

({                                                                          \
      if(type & VALUE_TYPE(class) == 0)                                       \
        { g_critical("not compatible types\n"); }                             \
      else                                                                    \
        {                                                                     \
          switch(VALUE_TYPE(class))                                           \
            {                                                                 \
            case T_INT   : CLASS(class)->value.content.vint;                  \
            case T_FLOAT : CLASS(class)->value.content.vfloat;                \
            case T_BOOL  : CLASS(class)->value.content.vbool;                 \
            case T_STRING: CLASS(class)->value.content.vstring;               \
            }                                                                 \
         }                                                                    \
  })


Function Documentation

void value_set struct s_value *    myval,
valuetype_t    type,
...   
 

Value initialisation.

visibility :: public

Remarks:
1. value is not a standalone variable. it's always included into a class (or one of its subtypes). So we don't have to allocate it.
Parameters:
myval  the value (a pointer)
type  the value type(int, bool, ...)
value  the value value(3, TRUE, ...)
Returns:
<none>

void value_translate struct s_value    to,
struct s_value    from
 

Value translation.

visibility :: public

Parameters:
to  the destination value
from  the source value
Returns:
<none>

void value_unset struct s_value    myval
 

Value desinitialisation.

visibility :: public

@remarks: 1. the value is not a standalone variable, so we don't have to free it. We must just free it's content if it's a string pointer

Parameters:
val  the value to clean
Returns:
<none>


Generated on Tue Aug 6 13:21:20 2002 for lafontaine by doxygen1.2.15