dt_Handle molecule, container, atom1, atomX;
  dt_String csmi, asmi, symbol;
  dt_Integer clen, alen, number, slen, charge;

  /* Read SMILES in. */
  molecule = dt_smilin(10, "[OH-].[H+]");

  /* Write canonical form. */ 
  csmi = dt_cansmiles(&clen, molecule, 0);
  /* Write abitrary form. */ 
  asmi = dt_arbsmiles(&alen, molecule, 0);

  printf("Canonical form is %.*s and arbitrary form is %.*s.\n",
         clen, csmi, alen, asmi);

  container = dt_stream(molecule, TYP_ATOM);

  /* next item gives the first atom */
  atom1 = dt_next(container);
  number = dt_number(atom1);
  symbol = dt_symbol(&slen, atom1);
  charge = dt_charge(atom1);
  printf("The atom number is %d, the symbol is \"%.*s\", "
         "and the charge is %d.\n", number, slen, symbol, charge);

  /* The next item gives the second atom. */
  atomX = dt_next(container);
  number = dt_number(atomX);
  symbol = dt_symbol(&slen, atomX);
  charge = dt_charge(atomX);
  printf("The atom number is %d, the symbol is \"%.*s\", "
         "and the charge is %d.\n", number, slen, symbol, charge);

  /* The next item is the NULL object. */
  atomX = dt_next(container);
  if (NULL_OB == atomX)
    printf("The NULL object is next.\n");

  /* A reset and next operation gives the first atom again. */
  dt_reset(container);
  atomX = dt_next(container);
  if (atomX == atom1)
    printf("Reset is like rewind.\n");

  /* Each atom refers to the molecule as its parent. */
  if (dt_parent(atomX) == molecule);
    printf("You can access the molecule through the atom.\n");
  /* The atom stream refers to the molecule as its base. */
 
if (dt_base(container) == molecule)
   
printf("You can access the molecule through the stream.\n");

 
/* The atoms are not deallocated when
    the atom stream is deallocated. */

 
dt_dealloc(container);
 
if (dt_invalid(atom1) == 0)
   
printf("The atom is not deallocated.\n");

 
/* The stream is deallocated when the molecule is deallocated */
 
container = dt_stream(molecule, TYP_ATOM);
 
dt_dealloc(molecule);
 
if (dt_invalid(container) == 1)
   
printf("The container is deallocated.\n");

Canonical form is [H+].[OH-] and arbitrary form is [OH-].[H+].
The atom number is 8, the symbol is "O", and the charge is -1.
The atom number is 1, the symbol is "H", and the charge is 1.
The NULL object is next.
Reset is like rewind.
You can access the molecule through the atom.
You can access the molecule through the stream.
The atom is not deallocated.
The container is deallocated.