Reduct  v1.0.4-3-gdaf0d70
A functional and immutable language.
Loading...
Searching...
No Matches
item.h File Reference

Item management. More...

#include "atom.h"
#include "closure.h"
#include "defs.h"
#include "function.h"
#include "list.h"
Include dependency graph for item.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  reduct_item_t
 Item structure. More...
 
struct  reduct_item_block_t
 Item block structure. More...
 

Macros

#define REDUCT_ITEM_TYPE_NONE   0
 No type.
 
#define REDUCT_ITEM_TYPE_ATOM   1
 An atom.
 
#define REDUCT_ITEM_TYPE_LIST   2
 A list.
 
#define REDUCT_ITEM_TYPE_FUNCTION   3
 A function.
 
#define REDUCT_ITEM_TYPE_CLOSURE   4
 A closure.
 
#define REDUCT_ITEM_TYPE_LIST_NODE   5
 A list node.
 
#define REDUCT_ITEM_FLAG_NONE   0
 No flags.
 
#define REDUCT_ITEM_FLAG_FALSY   (1 << 0)
 Item is falsy.
 
#define REDUCT_ITEM_FLAG_INT_SHAPED   (1 << 1)
 Item is an integer shaped atom.
 
#define REDUCT_ITEM_FLAG_FLOAT_SHAPED   (1 << 2)
 Item is a float shaped atom.
 
#define REDUCT_ITEM_FLAG_INTRINSIC   (1 << 3)
 Item is an atom and a intrinsic.
 
#define REDUCT_ITEM_FLAG_NATIVE   (1 << 4)
 Item is an atom and a native function.
 
#define REDUCT_ITEM_FLAG_QUOTED   (1 << 5)
 Item is a quoted atom.
 
#define REDUCT_ITEM_FLAG_GC_MARK   (1 << 6)
 Item is marked by GC.
 
#define REDUCT_ITEM_PAYLOAD_MAX   48
 The maximum size of the item payload.
 
#define REDUCT_ITEM_BLOCK_MAX   255
 The maximum number of items in a block.
 

Typedefs

typedef reduct_uint8_t reduct_item_type_t
 Item type enumeration.
 
typedef reduct_uint8_t reduct_item_flags_t
 Item flags enumeration.
 

Functions

REDUCT_API reduct_item_treduct_item_new (struct reduct *reduct)
 Allocate a new Reduct item.
 
REDUCT_API void reduct_item_free (struct reduct *reduct, reduct_item_t *item)
 Free an Reduct item.
 
REDUCT_API reduct_int64_t reduct_item_get_int (reduct_item_t *item)
 Get the integer value of an item if it is number shaped.
 
REDUCT_API reduct_float_t reduct_item_get_float (reduct_item_t *item)
 Get the float value of an item if it is number shaped.
 
REDUCT_API const char * reduct_item_type_str (reduct_item_type_t type)
 Get the string representation of an Reduct item type.
 

Detailed Description

Item management.

Definition in file item.h.