root/CRB_dev.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. CRB_FALSE
  2. CRB_TRUE
  3. CRB_Boolean
  4. CRB_BOOLEAN_VALUE
  5. CRB_INT_VALUE
  6. CRB_DOUBLE_VALUE
  7. CRB_STRING_VALUE
  8. CRB_NATIVE_POINTER_VALUE
  9. CRB_NULL_VALUE
  10. CRB_ARRAY_VALUE
  11. CRB_ValueType
  12. CRB_Value

#ifndef PUBLIC_CRB_DEV_H_INCLUDED
#define PUBLIC_CRB_DEV_H_INCLUDED

#define PRIVATE_CROWBAR_H_INCLUDED

typedef enum {
    CRB_FALSE = 0,
    CRB_TRUE = 1
} CRB_Boolean;

typedef struct CRB_Object_tag CRB_Object;
typedef struct CRB_Array_tag CRB_Array;
typedef struct CRB_String_tag CRB_String;

typedef enum {
    CRB_BOOLEAN_VALUE = 1,
    CRB_INT_VALUE,
    CRB_DOUBLE_VALUE,
    CRB_STRING_VALUE,
    CRB_NATIVE_POINTER_VALUE,
    CRB_NULL_VALUE,
    CRB_ARRAY_VALUE
} CRB_ValueType;

typedef struct {
    CRB_ValueType       type;
    union {
        CRB_Boolean     boolean_value;
        int             int_value;
        double          double_value;
        void            *native_pointer_value;
        CRB_Object      *object;
    } u;
} CRB_Value;

typedef CRB_Value CRB_NativeFunctionProc(CRB_Interpreter *interpreter,
                                         int arg_count, CRB_Value *args);

void CRB_add_native_function(CRB_Interpreter *interpreter,
                             char *name, CRB_NativeFunctionProc *proc);
void CRB_push_value(CRB_Interpreter *inter, CRB_Value *value);
CRB_Value CRB_pop_value(CRB_Interpreter *inter);
void CRB_shrink_stack(CRB_Interpreter *inter, int shrink_size);

#endif /* PUBLIC_CRB_DEV_H_INCLUDED */

/* [<][>][^][v][top][bottom][index][help] */