Main Page | Modules | Data Structures | File List | Globals | Related Pages

anx_general.h File Reference


Detailed Description

General functions related to Annodex media.

#include <annodex/anx_types.h>

Go to the source code of this file.

Functions

double anx_parse_time (const char *str)
 Time parsing.

int anx_last_error (ANNODEX *annodex)
 Retrieve the error code of the most recent error on an annodex.

const char * anx_strerror (ANNODEX *annodex)
 Retrieve a printable error string corresponding to the most recent error on annodex.

ANNODEXanx_open (char *filename, int flags)
 Open a file containing Annodex media.

ANNODEXanx_open_stdio (FILE *file, int flags)
 Attach to an existing file descriptor.

ANNODEXanx_new (int flags)
 Create a managed Annodex handle This is an alternative interface for non-file annodexes.

int anx_flush (ANNODEX *annodex)
 Flush any unwritten data associated with an annodex.

ANNODEXanx_close (ANNODEX *annodex)
 Close an annodex.

int anx_destroy (ANNODEX *annodex)
 Forcefully close an annodex without flushing any file descriptors.

int anx_ready (ANNODEX *annodex)
 Query if an annodex is ready.

int anx_eos (ANNODEX *annodex)
 Query if an annodex has reached its 'End Of Stream' markers.

AnxHead * anx_set_head (ANNODEX *annodex, AnxHead *head)
 Set the head element of the Annodex.

AnxHead * anx_get_head (ANNODEX *annodex)
 Get a copy of the head element of an annodex.

anx_int64_t anx_tell (ANNODEX *annodex)
 Query the current byte offset of an annodex.

int anx_seek_id (ANNODEX *annodex, const char *id)
 Seek to an anchor identified by id.

double anx_get_timebase (ANNODEX *annodex)
 Query the timebase of an annodex.

double anx_set_timebase (ANNODEX *annodex, double seconds)
double anx_tell_time (ANNODEX *annodex)
 Query the current offset of an annodex expressed as time in seconds.

double anx_seek_time (ANNODEX *annodex, double seconds, int whence)
 Seek to a time point in an annodex.

int anx_head_snprint (char *buf, int n, AnxHead *h)
 Print an AnxHead structure to a memory buffer.

int anx_clip_snprint (char *buf, int n, AnxClip *a, double start, double end)
 Print an AnxAnchor structure to a memory buffer.

AnxHead * anx_head_free (AnxHead *head)
 Free an AnxHead structure.

AnxClip * anx_clip_free (AnxClip *clip)
 Free an AnxClip structure.

AnxHead * anx_head_clone (AnxHead *head)
 Clone an AnxHead structure.

AnxClip * anx_clip_clone (AnxClip *clip)
 Clone an AnxClip structure.

AnxMetaElement * anx_meta_element_clone (AnxMetaElement *meta)
 Clone an AnxMetaElement structure.


Function Documentation

AnxClip* anx_clip_clone AnxClip *  clip  ) 
 

Clone an AnxClip structure.

Parameters:
clip the clip to clone
Returns:
a new clip structure
Note:
All components of the original clip are cloned, including all strings and its list of meta tags.

AnxClip* anx_clip_free AnxClip *  clip  ) 
 

Free an AnxClip structure.

Parameters:
clip the structure to free
Returns:
NULL on success

int anx_clip_snprint char *  buf,
int  n,
AnxClip *  a,
double  start,
double  end
 

Print an AnxAnchor structure to a memory buffer.

The head is serialized to XML conformant with the anxa DTD.

Parameters:
buf a buffer to print into
n the maximum number of characters to print
a the anchor to print
start the value of the 'start' attribute, as a time in seconds. If start is negative, the 'start' attribute is not printed.
Returns:
the number of characters printed, -1 on potential overrun
Bug:
This should follow C99 semantics

ANNODEX* anx_close ANNODEX annodex  ) 
 

Close an annodex.

Parameters:
annodex an ANNODEX* handle
Returns:
NULL on success; returns the unchanged annodex on failure (eg. due to system close() failing)

int anx_destroy ANNODEX annodex  ) 
 

Forcefully close an annodex without flushing any file descriptors.

Parameters:
annodex an ANNODEX* handle
Returns:
0 on success, -1 on failure

int anx_eos ANNODEX annodex  ) 
 

Query if an annodex has reached its 'End Of Stream' markers.

Parameters:
annodex an ANNODEX* handle
Returns:
0 if annodex is not at eos, 1 if it is

int anx_flush ANNODEX annodex  ) 
 

Flush any unwritten data associated with an annodex.

Parameters:
annodex An ANNODEX* handle
Returns:
0 on success, -1 on failure

AnxHead* anx_get_head ANNODEX annodex  ) 
 

Get a copy of the head element of an annodex.

Parameters:
annodex an ANNODEX* handle
Returns:
a copy of the head element

double anx_get_timebase ANNODEX annodex  ) 
 

Query the timebase of an annodex.

Parameters:
annodex an ANNODEX* handle
Returns:
the timebase of the annodex

AnxHead* anx_head_clone AnxHead *  head  ) 
 

Clone an AnxHead structure.

Parameters:
head the head to clone
Returns:
a new head structure
Note:
All components of the original head are cloned, including all strings and its list of meta tags.

AnxHead* anx_head_free AnxHead *  head  ) 
 

Free an AnxHead structure.

Parameters:
head the structure to free
Returns:
NULL on success

int anx_head_snprint char *  buf,
int  n,
AnxHead *  h
 

Print an AnxHead structure to a memory buffer.

The head is serialized to XML conformant with the anxhead DTD.

Parameters:
buf a buffer to print into
n the maximum number of characters to print
h the head to print
Returns:
the number of characters printed, -1 on potential overrun
Bug:
This should follow C99 semantics

int anx_last_error ANNODEX annodex  ) 
 

Retrieve the error code of the most recent error on an annodex.

Parameters:
annodex an ANNODEX* handle
Returns:
the error code of the most recent error

AnxMetaElement* anx_meta_element_clone AnxMetaElement *  meta  ) 
 

Clone an AnxMetaElement structure.

Parameters:
meta the meta tag structure to clone
Returns:
a new meta tag structure

ANNODEX* anx_new int  flags  ) 
 

Create a managed Annodex handle This is an alternative interface for non-file annodexes.

Parameters:
flags ANX_READ or ANX_WRITE
Returns:
an ANNODEX* handle

ANNODEX* anx_open char *  filename,
int  flags
 

Open a file containing Annodex media.

Parameters:
filename path to the file
flags ANX_READ or ANX_WRITE
Returns:
an ANNODEX* handle

ANNODEX* anx_open_stdio FILE *  file,
int  flags
 

Attach to an existing file descriptor.

Parameters:
fd an open file descriptor
flags ANX_READ or ANX_WRITE
Returns:
an ANNODEX* handle

int anx_ready ANNODEX annodex  ) 
 

Query if an annodex is ready.

Parameters:
annodex an ANNODEX* handle
Returns:
0 if annodex is not ready, 1 if it is

int anx_seek_id ANNODEX annodex,
const char *  id
 

Seek to an anchor identified by id.

Parameters:
annodex an ANNODEX* handle
id The id of the anchor to seek to

double anx_seek_time ANNODEX annodex,
double  seconds,
int  whence
 

Seek to a time point in an annodex.

Parameters:
annodex an ANNODEX* handle
seconds the time to seek to
whence whence parameter (defined in anx_constants.h)

AnxHead* anx_set_head ANNODEX annodex,
AnxHead *  head
 

Set the head element of the Annodex.

Parameters:
annodex an ANNODEX* handle
head a complete AnxHead structure to set
Returns:
the head if successful, NULL on failure
Note:
libannodex makes a copy of the head; it can be safely freed after returning from this call.

double anx_set_timebase ANNODEX annodex,
double  seconds
 

Parameters:
annodex an ANNODEX* handle
seconds the new timebase

const char* anx_strerror ANNODEX annodex  ) 
 

Retrieve a printable error string corresponding to the most recent error on annodex.

Parameters:
annodex an ANNODEX* handle
Returns:
an error string

anx_int64_t anx_tell ANNODEX annodex  ) 
 

Query the current byte offset of an annodex.

Parameters:
annodex an ANNODEX* handle
Returns:
the current byte offset XXX: Deprecated?

double anx_tell_time ANNODEX annodex  ) 
 

Query the current offset of an annodex expressed as time in seconds.

Parameters:
annodex an ANNODEX* handle
Returns:
the current time offset


Generated on Sat May 22 19:44:48 2004 for libannodex by doxygen 1.3.5