コード例 #1
0
ファイル: text_writer.c プロジェクト: stojadin/oml
/** 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;
}
コード例 #2
0
ファイル: bin_writer.c プロジェクト: lees0414/EUproject
/** 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;
}