
Data Structures | |
| struct | asa_import_state |
| state of a running import More... | |
Defines | |
| #define | MAXDELTA 4 |
| nr of times kept for delta backref | |
| #define | MAXGROUP 24 |
| maximum number of regex match groups | |
| #define | xmalloc malloc |
| #define | xrealloc realloc |
| #define | xfree free |
| #define | xstrdup strdup |
| #define | iargs struct asa_import_state *state, struct asa_import_insn *insn |
| #define | ASAI_MAX (unsigned)(sizeof(importfuncs) / sizeof(importfuncs[0])) |
Typedefs | |
| typedef int(* | asa_import_func )(struct asa_import_state *state, struct asa_import_insn *insn) |
| asa instruction function. | |
Functions | |
| static int | asai_commit (struct asa_import_state *state, struct asa_import_insn *insn) |
| asai_commit - commit a block to the user. | |
| static int | asai_discard (struct asa_import_state *state, struct asa_import_insn *insn) |
| asai_discard - clear the buffer without committing. | |
| static int | asai_break (struct asa_import_state *state, struct asa_import_insn *insn) |
| asai_break - jump out of child. | |
| static int | asai_select (struct asa_import_state *state, struct asa_import_insn *insn) |
| asai_select - choose a match group to be the active one. | |
| static int | asai_sg (struct asa_import_state *state, struct asa_import_insn *insn) |
| asai_sg - search and replace. | |
| static int | asai_sgu (struct asa_import_state *state, struct asa_import_insn *insn) |
| asai_sgu - replace one time and update matches. | |
| static int | asai_append (struct asa_import_state *state, struct asa_import_insn *insn) |
| asai_append - append selected string to output buffer. | |
| static int | asai_fps (struct asa_import_state *state, struct asa_import_insn *insn) |
| asai_fps - override fps. | |
| static int | asai_show (struct asa_import_state *state, struct asa_import_insn *insn) |
| asai_show - set start time. | |
| static int | asai_hide (struct asa_import_state *state, struct asa_import_insn *insn) |
| asai_hide - set end time. | |
| static int | asai_child (struct asa_import_state *state, struct asa_import_insn *insn) |
| asai_child - execute childs if we match. | |
| static void | asa_imports_crosslink (void) |
| asa_imports_crosslink - resolve references in imports file. | |
| struct asa_import_detect * | asa_imports_detect (const void *data, size_t dlen) |
| asa_imports_detect - autodetect subtitle format. | |
| static int | asai_run_insns (struct asa_import_state *state, struct asa_import_insn *insn) |
| asai_run_insns - execute a list of instructions. | |
| static ptrdiff_t | asai_process_replace (struct asa_import_state *state, struct asa_import_insn *insn, int *v, int rv) |
| static char ** | asai_chunk_alloc (char **old, int *v, int rv) |
| asai_chunk_alloc - allocate composite chunk. | |
| static void | asai_set_matches (struct asa_import_state *state, const char *src, int *v, int rv) |
| asai_set_matches - load result from pcre_exec into matches | |
| static int64_t | asai_gettime (struct asa_import_state *state, struct asa_import_insn *insn) |
| asai_gettime - walk asa_tspec and sum up the time. | |
| int | asa_import (demux_t *d, const void *data, size_t dlen, int64_t usecperframe, struct asa_import_detect *det, asa_import_callback *callback, void *arg) |
| int | asa_pcre_compile (asa_pcre *out, const char *str) |
| pcre_compile wrapper. | |
| void | asa_init_import () |
Variables | |
| static const asa_import_func | importfuncs [] |
| vm functions. | |
| struct asa_import_detect * | asa_det_first = NULL |
| struct asa_import_detect ** | asa_det_last = &asa_det_first |
| struct asa_import_format * | asa_fmt_first = NULL |
| struct asa_import_format ** | asa_fmt_last = &asa_fmt_first |
| #define ASAI_MAX (unsigned)(sizeof(importfuncs) / sizeof(importfuncs[0])) |
Referenced by asai_run_insns().
| #define iargs struct asa_import_state *state, struct asa_import_insn *insn |
| #define MAXDELTA 4 |
| #define MAXGROUP 24 |
| #define xfree free |
Referenced by asa_import(), asai_commit(), asai_discard(), asai_select(), asai_set_matches(), asai_sg(), and asai_sgu().
| #define xmalloc malloc |
Referenced by asai_process_replace().
| #define xrealloc realloc |
Referenced by asai_append(), asai_chunk_alloc(), and asai_process_replace().
| #define xstrdup strdup |
Referenced by asai_select(), and asai_set_matches().
| typedef int(* asa_import_func)(struct asa_import_state *state, struct asa_import_insn *insn) |
asa instruction function.
| state | import state | |
| insn | instruction to execute |
| int asa_import | ( | demux_t * | d, | |
| const void * | data, | |||
| size_t | dlen, | |||
| int64_t | usecperframe, | |||
| struct asa_import_detect * | det, | |||
| asa_import_callback * | callback, | |||
| void * | arg | |||
| ) |
References asai_run_insns(), callback(), asa_import_state::cb, asa_import_state::cb_arg, asa_import_state::demux, asa_import_state::end, asa_import_detect::fmt, asa_import_format::insns, asa_import_state::line, asa_import_state::matches, asa_import_state::origusecperf, asa_import_state::out, asa_import_state::outlen, asa_import_state::remain, asa_import_state::selstr, asa_import_state::start, asa_import_state::usecperf, and xfree.
| static void asa_imports_crosslink | ( | void | ) | [static] |
asa_imports_crosslink - resolve references in imports file.
updates asa_import_format.prevtgt, asa_import_format.nexttgt, asa_import_detect.fmt
References det, asa_import_detect::fmt, asa_import_detect::name, asa_import_format::name, asa_import_detect::next, asa_import_format::next, asa_import_format::nexttgt, and asa_import_format::prevtgt.
Referenced by asa_init_import().
| struct asa_import_detect* asa_imports_detect | ( | const void * | data, | |
| size_t | dlen | |||
| ) | [read] |
asa_imports_detect - autodetect subtitle format.
| data | pointer to subtitle byte data | |
| datalen | byte length of data |
References det, asa_import_detect::next, asa_pcre::pcre, and asa_import_detect::re.
| void asa_init_import | ( | void | ) |
References asa_imports_crosslink(), and preparse_add().
| int asa_pcre_compile | ( | asa_pcre * | out, | |
| const char * | str | |||
| ) |
pcre_compile wrapper.
used to allow loading differently for imports-to-C conversion.
| out | output (parsed pcre) | |
| str | regular expression string |
References err, and asa_pcre::pcre.
| static int asai_append | ( | struct asa_import_state * | state, | |
| struct asa_import_insn * | insn | |||
| ) | [static] |
asai_append - append selected string to output buffer.
References asa_import_state::out, asa_import_state::outlen, asa_import_state::sellen, asa_import_state::selstr, and xrealloc.
| static int asai_break | ( | struct asa_import_state * | state, | |
| struct asa_import_insn * | insn | |||
| ) | [static] |
asai_break - jump out of child.
References asa_import_insn::break_depth, and asa_import_insn::v.
| static int asai_child | ( | struct asa_import_state * | state, | |
| struct asa_import_insn * | insn | |||
| ) | [static] |
asai_child - execute childs if we match.
< maximum number of regex match groups
< maximum number of regex match groups
References asai_run_insns(), asai_set_matches(), asa_import_insn::child, asa_import_state::line, MAXGROUP, asa_import_state::remain, and asa_import_insn::v.
| static char** asai_chunk_alloc | ( | char ** | old, | |
| int * | v, | |||
| int | rv | |||
| ) | [inline, static] |
asai_chunk_alloc - allocate composite chunk.
Referenced by asai_set_matches().
| static int asai_commit | ( | struct asa_import_state * | state, | |
| struct asa_import_insn * | insn | |||
| ) | [static] |
asai_commit - commit a block to the user.
References asa_import_state::cb, asa_import_state::cb_arg, asa_import_state::demux, asa_import_state::end, asa_import_state::out, asa_import_state::outlen, asa_import_state::start, and xfree.
| static int asai_discard | ( | struct asa_import_state * | state, | |
| struct asa_import_insn * | insn | |||
| ) | [static] |
asai_discard - clear the buffer without committing.
References asa_import_state::out, asa_import_state::outlen, and xfree.
| static int asai_fps | ( | struct asa_import_state * | state, | |
| struct asa_import_insn * | insn | |||
| ) | [static] |
asai_fps - override fps.
References asa_import_insn::fps_value, asa_import_state::origusecperf, asa_import_state::usecperf, and asa_import_insn::v.
| static int64_t asai_gettime | ( | struct asa_import_state * | state, | |
| struct asa_import_insn * | insn | |||
| ) | [static] |
asai_gettime - walk asa_tspec and sum up the time.
< nr of times kept for delta backref
< nr of times kept for delta backref
< nr of times kept for delta backref
References asa_import_state::delta, asa_import_state::demux, asa_tspec::fps_mult, asa_tspec::group, asa_import_state::matches, MAXDELTA, msg_Err, msg_Warn, asa_tspec::mult, asa_tspec::next, asa_import_state::nmatches, src, tsp, asa_import_insn::tspec, asa_import_state::usecperf, and asa_import_insn::v.
Referenced by asai_hide(), and asai_show().
| static int asai_hide | ( | struct asa_import_state * | state, | |
| struct asa_import_insn * | insn | |||
| ) | [static] |
asai_hide - set end time.
References asai_gettime(), and asa_import_state::end.
| static ptrdiff_t asai_process_replace | ( | struct asa_import_state * | state, | |
| struct asa_import_insn * | insn, | |||
| int * | v, | |||
| int | rv | |||
| ) | [static] |
References asa_import_state::demux, asa_repl::group, msg_Err, asa_repl::next, asa_import_state::sellen, asa_import_state::selstr, asa_import_insn::sg, src, asa_repl::text, asa_import_insn::v, xmalloc, and xrealloc.
Referenced by asai_sg(), and asai_sgu().
| static int asai_run_insns | ( | struct asa_import_state * | state, | |
| struct asa_import_insn * | insn | |||
| ) | [static] |
asai_run_insns - execute a list of instructions.
References ASAI_CHILD, ASAI_MAX, importfuncs, asa_import_insn::insn, and asa_import_insn::next.
Referenced by asa_import(), and asai_child().
| static int asai_select | ( | struct asa_import_state * | state, | |
| struct asa_import_insn * | insn | |||
| ) | [static] |
asai_select - choose a match group to be the active one.
References asa_import_state::demux, asa_import_state::matches, msg_Err, asa_import_state::nmatches, asa_import_insn::select, asa_import_state::sellen, asa_import_state::selstr, asa_import_insn::v, xfree, and xstrdup.
| static void asai_set_matches | ( | struct asa_import_state * | state, | |
| const char * | src, | |||
| int * | v, | |||
| int | rv | |||
| ) | [static] |
asai_set_matches - load result from pcre_exec into matches
References asai_chunk_alloc(), i, asa_import_state::matches, asa_import_state::nmatches, asa_import_state::sellen, asa_import_state::selstr, xfree, and xstrdup.
Referenced by asai_child(), and asai_sgu().
| static int asai_sg | ( | struct asa_import_state * | state, | |
| struct asa_import_insn * | insn | |||
| ) | [static] |
asai_sg - search and replace.
< maximum number of regex match groups
< maximum number of regex match groups
References asai_process_replace(), MAXGROUP, asa_import_state::sellen, asa_import_state::selstr, asa_import_insn::sg, asa_import_insn::v, and xfree.
| static int asai_sgu | ( | struct asa_import_state * | state, | |
| struct asa_import_insn * | insn | |||
| ) | [static] |
asai_sgu - replace one time and update matches.
< maximum number of regex match groups
< maximum number of regex match groups
References asai_process_replace(), asai_set_matches(), MAXGROUP, asa_import_state::sellen, asa_import_state::selstr, asa_import_insn::sg, asa_import_insn::v, and xfree.
| static int asai_show | ( | struct asa_import_state * | state, | |
| struct asa_import_insn * | insn | |||
| ) | [static] |
asai_show - set start time.
References asai_gettime(), and asa_import_state::start.
| struct asa_import_detect* asa_det_first = NULL |
| struct asa_import_detect ** asa_det_last = &asa_det_first |
| struct asa_import_format* asa_fmt_first = NULL |
| struct asa_import_format ** asa_fmt_last = &asa_fmt_first |
const asa_import_func importfuncs[] [static] |
Initial value:
{
asai_commit,
asai_discard,
asai_break,
asai_select,
asai_sg,
asai_sgu,
asai_append,
asai_fps,
asai_show,
asai_hide,
asai_child
}
KEEP IN SYNC WITH imports.h!
Referenced by asai_run_insns().
1.5.6