ptttl v0.2.0
C implementation of a PTTTL parser. PTTTL is a superset of NOKIA's RTTTL that adds polyphony & vibrato.
Loading...
Searching...
No Matches
Public Attributes | List of all members
ptttl_parser_input_iface_t Struct Reference

#include <ptttl_parser.h>

Public Attributes

int(* read )(char *input_char)
 
int(* seek )(uint32_t position)
 

Detailed Description

Holds function pointers that make up an interface for reading PTTTL source from various locations (e.g. from memory, or from a file)

Member Data Documentation

◆ read

int(* ptttl_parser_input_iface_t::read) (char *input_char)

Callback function to fetch the next character of PTTTL/RTTTL source

Parameters
input_charPointer to location to store fetched PTTTL/RTTTL source character
Returns
0 if successful, 1 if no more characters remain, and -1 if an error occurred (causes parsing to halt early)

◆ seek

int(* ptttl_parser_input_iface_t::seek) (uint32_t position)

Callback function to seek to an absolute position within the input text

Parameters
position0-based position to seek to. For example, if the position is 0, then the next 'read' call should return the first character of the input text, and if the position is 23, then the next 'read' call should return the 24th character of the input text, and so on.
Returns
0 if successful, 1 if an invalid position was provided, and -1 if an error occurred (causes parsing to halt early)

The documentation for this struct was generated from the following file: