dt_Handle transform, container, molecule1, moleculeX;
  dt_String asmi;
  dt_Integer alen;

  /* Read SMIRKS in. */
  transform = dt_smirkin(25, "[O:1][H:2]>>[O-:1].[H+:2]");

  /* Put molecules in the sequence. */
  container = dt_alloc_seq();
  molecule1 = dt_smilin(1, "O");
  dt_append(container, molecule1);
  moleculeX = dt_smilin(12, "Oc1ccc(O)cc1");
  dt_append(container, moleculeX);

  /* The next item gives the first molecule. */
  molecule1 = dt_next(container);
  asmi = dt_arbsmiles(&alen, molecule1, 0);
    printf("The molecule1 is %.*s.\n", alen, asmi);

  /* The next item gives the second molecule */
  moleculeX = dt_next(container);
  asmi = dt_arbsmiles(&alen, moleculeX, 0);
    printf("The moleculeX is %.*s.\n", alen, asmi);

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

  /* A reset and next operation gives the first molecule again. */
  moleculeX = dt_next(container);
  if (moleculeX == molecule1)
    printf("Reset is like rewind.\n");
  /* The molecule sequence is not invalid when adding an atom
    to a molecule, or when a molecule is deallocated. */

if (dt_invalid(container) == 0)
printf("The sequence is valid.\n");

The molecule1 is O.
The moleculeX is Oc1ccc(cc1)O.
The NULL object is next.
Reset is like rewind.
The sequence is valid.