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

Atom representation and operations. More...

#include "defs.h"
#include "intrinsic.h"
#include "native.h"
Include dependency graph for atom.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  reduct_atom_t
 Atom structure. More...
 

Macros

#define REDUCT_ATOM_SMALL_MAX   15
 The maximum length of a small atom.
 
#define REDUCT_FNV_PRIME   16777619U
 FNV-1a 32-bit prime.
 
#define REDUCT_FNV_OFFSET   2166136261U
 FNV-1a 32-bit offset basis.
 

Enumerations

enum  reduct_atom_lookup_flags_t { REDUCT_ATOM_LOOKUP_NONE = 0 , REDUCT_ATOM_LOOKUP_QUOTED = 1 << 0 }
 Atom lookup flags. More...
 

Functions

static REDUCT_ALWAYS_INLINE reduct_uint32_t reduct_hash (const char *str, reduct_size_t len)
 Hash a string.
 
static void reduct_atom_init (reduct_atom_t *atom)
 Initialize an atom.
 
REDUCT_API void reduct_atom_deinit (struct reduct *reduct, reduct_atom_t *atom)
 Deinitialize an atom.
 
static REDUCT_ALWAYS_INLINE reduct_bool_t reduct_atom_is_equal (reduct_atom_t *atom, const char *str, reduct_size_t len)
 Check if an atom is equal to a string.
 
REDUCT_API reduct_atom_treduct_atom_lookup_int (struct reduct *reduct, reduct_int64_t value)
 Lookup an atom by integer value.
 
REDUCT_API reduct_atom_treduct_atom_lookup_float (struct reduct *reduct, reduct_float_t value)
 Lookup an atom by float value.
 
REDUCT_API reduct_atom_treduct_atom_lookup (struct reduct *reduct, const char *str, reduct_size_t len, reduct_atom_lookup_flags_t flags)
 Lookup an atom in the Reduct structure.
 
REDUCT_API void reduct_atom_normalize (struct reduct *reduct, reduct_atom_t *atom)
 Normalize an atom, determining its shape and parsing escape sequences.
 

Detailed Description

Atom representation and operations.

Definition in file atom.h.