Main Page   Data Structures   File List   Data Fields   Globals  

control.h File Reference

#include <pthread.h>
#include "libdaisy.h"
#include "audio.h"

Go to the source code of this file.

Data Structures

struct  AuthorNode
struct  BookInfo
struct  DaisyData
struct  Node
struct  SmilNode

Functions

DaisyDataparseInit (void)
void parseTerminate (struct DaisyData *daisydata)
char * removewhitespaces (char *string)
char * tolowercase (const char *string)
char * getTime (char *time)
void addNewAuthor (struct DaisyData *daisydata)
SmilNodeaddNewSmilNode (struct DaisyData *daisydata)
NodeaddNewNode (struct DaisyData *daisydata)
int parse (struct DaisyData *daisydata, char *filename)
int seek (struct DaisyData *daisydata, int type)
int getSmilPos (struct DaisyData *daisydata)
int getNodePos (struct DaisyData *daisydata)
int gotoSmilPosition (struct DaisyData *daisydata, int newSmilPos)
int gotoNodePosition (struct DaisyData *daisydata, int newNodePos)


Function Documentation

void addNewAuthor struct DaisyData   daisydata
 

Adds a new author to the main data structures author list.

Parameters:
daisydata  - a pointer to the datastructure initialized by parseInit ().

struct Node* addNewNode struct DaisyData   daisydata
 

Adds a new passage node at the end of the linked node list in the main datastructure of the loaded daisy DTB.

Parameters:
daisydata  - a pointer to the datastructure initialized by parseInit ().
Returns:
a pointer to the new node.

struct SmilNode* addNewSmilNode struct DaisyData   daisydata
 

Adds a new SmilNode at the end of the linked smil list in the main datastructure of the loaded daisy DTB.

Parameters:
daisydata  - the datastructure initialized by parseInit ().
Returns:
a pointer to the new smilNode.

int getNodePos struct DaisyData   daisydata
 

Function for getting the current playback position in the node list.

Parameters:
daisydata  - a pointer to the datastructure initialized by parseInit ().
Returns:
the current position or -1 on error.

Referenced by daisy_get_position().

int getSmilPos struct DaisyData   daisydata
 

Function for getting the current playback position in the smil list.

Parameters:
daisydata  - a pointer to the datastructure initialized by parseInit ().
Returns:
the current position or -1 on error.

Referenced by daisy_get_position().

char* getTime char *    time
 

Converts min:sec.frac to sec.frac.

Parameters:
time  - a pointer to the string to convert.
Returns:
a pointer to the string contianing the offset.

int gotoNodePosition struct DaisyData   daisydata,
int    newNodePos
 

Function to move to a spesific node in the smil list and parse it.

Parameters:
daisydata  - a pointer to the datastructure initialized by parseInit ().
newNodePos  - the position in the linked node list to move to.
Returns:
1 on success and -1 on error.

Referenced by daisy_goto_position().

int gotoSmilPosition struct DaisyData   daisydata,
int    newSmilPos
 

Function to move to a spesific node in the smil list and parse it.

Parameters:
daisydata  - a pointer to the datastructure initialized by parseInit ().
newSmilPos  - the position in the linked smil list to move to.
Returns:
1 on success and -1 on error.

Referenced by daisy_goto_position().

int parse struct DaisyData   daisydata,
char *    filename
 

Parses a NCC or a NCX file (*.ncc | ncx.*) and fills the smilNode list with the smil file information representing the spine of the daisy DTB.

Parameters:
daisydata  - a pointer to the datastructure initialized by parseInit ().
filename  - a pointer to a string containing the path and filename to the ncc/ncx file to parse.
Returns:
1 in case of success and -1 in case of error

Referenced by daisy_load().

struct DaisyData* parseInit void   
 

Initializes the main datastructure of the loaded daisy DTB.

Returns:
a pointer to the main datastructure for loading a daisy DTB.

Referenced by daisy_init().

void parseTerminate struct DaisyData   daisydata
 

Frees all memory allocated by the parser and the main datastructure. Terminates all parsing functionality.

Parameters:
daisydata  - a pointer to the datastructure initialized by parseInit ().

Referenced by daisy_term().

char* removewhitespaces char *    string
 

Removes whitespaces, newlines and tabs before and after a sentence.

Parameters:
string  - a pointer to the string to check.
Returns:
a pointer to the new string if the sentence contains any characters, otherwise NULL.

int seek struct DaisyData   daisydata,
int    type
 

Function for seeking in the data structure. It can seek paragraphs (nodes) and chapters (smilnode).

Parameters:
daisydata  - a pointer to the datastructure initialized by parseInit ().
type  - an daisy_seek_option, the type of seek you want to performe.
Returns:
0 if end_of_book, 1 if success and -1 on error.

Referenced by daisy_load(), and daisy_seek().

char* tolowercase const char *    string
 

Converts the string to lower case.

Parameters:
string  - a pointer to the string which is going to be in lowercase.
Returns:
a pointer to the new string with lowercase, otherwise NULL.


Generated on Tue Sep 5 12:14:08 2006 for libdaisy by doxygen1.2.15