Ejemplo n.º 1
0
OggzTable *
oggz_table_new (void)
{
  OggzTable * table;

  table = oggz_malloc (sizeof (OggzTable));
  table->keys = oggz_vector_new ();
  table->data = oggz_vector_new ();

  return table;
}
Ejemplo n.º 2
0
Archivo: oggz.c Proyecto: mariuz/haiku
OGGZ *
oggz_new (int flags)
{
  OGGZ * oggz;

  if (oggz_flags_disabled (flags)) return NULL;

  oggz = (OGGZ *) oggz_malloc (sizeof (OGGZ));
  if (oggz == NULL) return NULL;

  oggz->flags = flags;
  oggz->file = NULL;
  oggz->io = NULL;

  oggz->offset = 0;
  oggz->offset_data_begin = 0;

  oggz->streams = oggz_vector_new ();
  oggz->all_at_eos = 0;

  oggz->metric = NULL;
  oggz->metric_user_data = NULL;
  oggz->metric_internal = 0;

  oggz->order = NULL;
  oggz->order_user_data = NULL;

  if (OGGZ_CONFIG_WRITE && (oggz->flags & OGGZ_WRITE)) {
    oggz_write_init (oggz);
  } else if (OGGZ_CONFIG_READ) {
    oggz_read_init (oggz);
  }

  return oggz;
}
Ejemplo n.º 3
0
/* Internal API */
int
oggz_comments_init (oggz_stream_t * stream)
{
    stream->vendor = NULL;
    stream->comments = oggz_vector_new ();
    oggz_vector_set_cmp (stream->comments, (OggzCmpFunc) oggz_comment_cmp, NULL);

    return 0;
}