Exemplo n.º 1
0
/** Close the text writer and free data structures.
 *
 * This function is designed so it can be used in a while loop to clean up the
 * entire linked list:
 *
 *   while( (w=w->close(w)) );
 *
 * \param writer pointer to the writer to close
 * \return w->next (can be null)
 */
static int
close(OmlWriter* writer)
{
  OmlWriter *next;

  if(!writer)
    return NULL;

  OmlTextWriter *self = (OmlTextWriter*) writer;

  next = self->next;

  // Blocks until the buffered writer drains
  bw_close (self->bufferedWriter);
  xfree(self);

  return next;
}
Exemplo n.º 2
0
/** Function called to close the writer and free its allocated objects.
 * \see oml_writer_close
 */
static OmlWriter*
owb_close(OmlWriter* writer)
{
  OmlWriter *next;

  if(!writer) {
    return NULL;
  }

  OmlBinWriter *self = (OmlBinWriter*) writer;

  next = self->next;

  // Blocks until the buffered writer drains
  bw_close (self->bufferedWriter);
  oml_free(self);

  return next;
}