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_String
  5. CRB_BOOLEAN_VALUE
  6. CRB_INT_VALUE
  7. CRB_DOUBLE_VALUE
  8. CRB_STRING_VALUE
  9. CRB_NATIVE_POINTER_VALUE
  10. CRB_NULL_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_String_tag {
    int         ref_count;
    char        *string;
    CRB_Boolean is_literal;
} 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_ValueType;

typedef struct {
    CRB_ValueType       type;
    union {
        CRB_Boolean     boolean_value;
        int             int_value;
        double          double_value;
        CRB_String      *string_value;
        void            *native_pointer_value;
    } 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);

#endif /* PUBLIC_CRB_DEV_H_INCLUDED */

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