.\" -*-nroff-*-
-.de VS
-.sp 1
-.RS
-.nf
-.ft B
-..
-.de VE
-.ft R
-.fi
-.RE
-.sp 1
-..
-.TH atom 3 "21 January 2001" "Straylight/Edgeware" "mLib utilities library"
-.SH NAME
-atom \- atom table manager
+.\"
+.\" Manual for atom interning
+.\"
+.\" (c) 2001, 2005, 2009, 2023, 2024 Straylight/Edgeware
+.\"
+.
+.\"----- Licensing notice ---------------------------------------------------
+.\"
+.\" This file is part of the mLib utilities library.
+.\"
+.\" mLib is free software: you can redistribute it and/or modify it under
+.\" the terms of the GNU Library General Public License as published by
+.\" the Free Software Foundation; either version 2 of the License, or (at
+.\" your option) any later version.
+.\"
+.\" mLib is distributed in the hope that it will be useful, but WITHOUT
+.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+.\" License for more details.
+.\"
+.\" You should have received a copy of the GNU Library General Public
+.\" License along with mLib. If not, write to the Free Software
+.\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+.\" USA.
+.
+.\"--------------------------------------------------------------------------
+.so ../defs.man \" @@@PRE@@@
+.
+.\"--------------------------------------------------------------------------
+.TH atom 3mLib "21 January 2001" "Straylight/Edgeware" "mLib utilities library"
.\" @atom_createtable
.\" @atom_destroytable
.\" @atom_intern
.\" @atom_hash
.\" @atom_mkiter
.\" @atom_next
-.\"
+.
.\" @ATOM_GLOBAL
.\" @INTERN
.\" @GENSYM
.\" @ATOM_NAME
.\" @ATOM_LEN
.\" @ATOM_HASH
-.\"
+.
+.\"--------------------------------------------------------------------------
+.SH NAME
+atom \- atom table manager
+.
.SH SYNOPSIS
+.
.nf
.B "#include <mLib/atom.h>"
.PP
.PP
.BI "extern atom_table *ATOM_GLOBAL;"
.fi
+.
+.\"--------------------------------------------------------------------------
.SH DESCRIPTION
The
.B atom
.B atom_createtable
and free it when you're finished using
.BR atom_destroytable .
+.
.SS "Creating atoms from strings"
The process of making atoms from strings is called
.IR interning .
the atom's length as reported by the
.B ATOM_LEN
macro.
+.
.SS "Uninterned atoms"
You can make an atom which is guaranteed to be distinct from every other
atom, and has no sensible text string, by calling
is an atom-table-specific sequence number. This text is there as a
debugging convenience, and doesn't mean that the uninterned atom has the
same address as an interned atom with the same text.
+.
.SS "Other enquiries about atoms"
Atoms can be interrogated to find their names and hashes. The macro
.B ATOM_NAME
atom as a key in some other structure. There are lower-case function
versions of these, which have the same effect. There is little point in
using the functions.
+.
.SS "Enumerating atoms"
You can iterate over the atoms in an atom table. The
.B atom_mkiter
.B atom_next
returns the next atom from the iterator. Atoms are not returned in any
particular order.
+.
+.\"--------------------------------------------------------------------------
.SH SEE ALSO
+.
.BR assoc (3),
.BR hash (3),
.BR mLib (3).
+.
+.\"--------------------------------------------------------------------------
.SH AUTHOR
+.
Mark Wooding, <mdw@distorted.org.uk>
+.
+.\"----- That's all, folks --------------------------------------------------