If the Annodex media you wish to access is directly available as a local file or via a file descriptor (such as a network socket), it can be directly opened as follows:
- open an annodex using anx_open() or anx_openfd()
- attach read callbacks using anx_set_read_*_callback()
- call anx_read() repeatedly until it returns 0 or -1
- close the annodex with anx_close()
This procedure is illustrated in src/examples/print-title-file.c:
#include <stdio.h>
static int
{
return ANX_CONTINUE;
}
int
main (int argc, char *argv[])
{
char * filename;
long n;
if (argc != 2) {
fprintf (stderr, "Usage: %s file.anx\n", argv[0]);
exit (1);
}
filename = argv[1];
exit (0);
}
int anx_set_read_head_callback(ANNODEX *annodex, AnxReadHead read_head, void *user_data)
Set the function to call when the head element is read.
long anx_read(ANNODEX *annodex, long n)
Read from an annodex opened with anx_open() or anx_open_stdio().