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. */
  dt_reset(container);
  moleculeX = dt_next(container);
  if (moleculeX == molecule1)
    printf("Reset is like rewind.\n");
  /* The molecule sequence does not refer to another object. */
 
if (dt_base(container) == NULL_OB)
   
printf("There is no base object of the sequence.\n");

 
/* The proper way to deallocate a sequence and its
    contents is to reset the container, delete and
    deallocate each item, then deallocate the container. */

 
dt_reset(container);
 
while (NULL_OB != (moleculeX = dt_next(container))) {
   
dt_delete(moleculeX);
   
dt_dealloc(moleculeX);
 
}
 
dt_dealloc(container);

The molecule1 is O.
The moleculeX is Oc1ccc(cc1)O.
The NULL object is next.
Reset is like rewind.
There is no base object of the sequence.