X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=src%2Fatom.h;h=787fece4f5c5bbfd3e47a76a0ad3113fed27a3ce;hb=refs%2Fheads%2Fmaster;hp=5b71ad3441822f6c11e8d0842d66b22a42895639;hpb=58a5ffdfec139a0c9d399f603b77a764ae8607f7;p=muddle-interpreter.git diff --git a/src/atom.h b/src/atom.h index 5b71ad3..787fece 100644 --- a/src/atom.h +++ b/src/atom.h @@ -21,14 +21,21 @@ License along with this file. If not, see #include "object.h" -typedef struct +typedef struct atom_body atom_body; + +// Return an atom with a newly-allocated body. +atom_object atom_create (const char *name, uint32_t namelen); + +atom_body *ATOM_BODY (heap_ptr p); + +const char *atom_pname (atom_object o); + +inline static uint32_t +atom_namelen (atom_object body) { - evaltype type; // UNBOUND/LOCI - // bindid - // value ptr - // oblist ptr - // type ptr - const char pname[]; -} atom_body; + return body.val.namelen; +} + +heap_ptr atom_body_alloc (uint32_t ct); #endif