Commit Graph

6 Commits

Author SHA1 Message Date
Corey Farrell a36a174c4b pbx: Create pbx_sw.c for management of 'struct ast_sw'.
This changes context switches from a linked list to a vector, makes
'struct ast_sw' opaque to pbx.c.

Although ast_walk_context_switches is maintained the procedure is no
longer efficient except for the first call (inc==NULL).  This
functionality is replaced by two new functions implemented by vector
macros.
* ast_context_switches_count (AST_VECTOR_SIZE)
* ast_context_switches_get (AST_VECTOR_GET)

As with ast_walk_context_switches callers of these functions are
expected to have locked contexts.  Only a few places in Asterisk walked
the switches, they have been converted to use the new functions.

Change-Id: I08deb016df22eee8288eb03de62593e45a1f0998
2016-07-21 13:58:26 -04:00
Corey Farrell e2e8713b84 pbx: Create pbx_ignorepat.c for management of 'struct ast_ignorepat'.
This changes context ignore patterns from a linked list to a vector,
makes 'struct ast_ignorepat' opaque to pbx.c.

Although ast_walk_context_ignorepats is maintained the procedure is no
longer efficient except for the first call (inc==NULL).  This
functionality is replaced by two new functions implemented by vector
macros.
* ast_context_ignorepats_count (AST_VECTOR_SIZE)
* ast_context_ignorepats_get (AST_VECTOR_GET)

As with ast_walk_context_ignorepats callers of these functions are
expected to have locked contexts.  Only a few places in Asterisk walked
the ignorepats, they have been converted to use the new functions.

Change-Id: I78f2157d275ef1b7d624b4ff7d770d38e5d7f20a
2016-07-18 03:21:43 -04:00
Corey Farrell be36bd7ca5 pbx: Create pbx_include.c for management of 'struct ast_include'.
This changes context includes from a linked list to a vector, makes
'struct ast_include' opaque to pbx.c.

Although ast_walk_context_includes is maintained the procedure is no
longer efficient except for the first call (inc==NULL).  This
functionality is replaced by two new functions implemented by vector
macros.
* ast_context_includes_count (AST_VECTOR_SIZE)
* ast_context_includes_get (AST_VECTOR_GET)

As with ast_walk_context_includes callers of these functions are
expected to have locked contexts.  Only a few places in Asterisk walked
the includes, they have been converted to use the new functions.

const have been applied where possible to parameters for ast_include
functions.

Change-Id: Ib5c882e27cf96fb2aec67a39c18b4c71c9c83b60
2016-07-15 05:34:29 -04:00
Corey Farrell 3507494b8a main/pbx: Move dialplan application management routines to pbx_app.c.
This is the sixth patch in a series meant to reduce the bulk of pbx.c.
This moves dialplan application management functions to their own source.

Change-Id: I444c10fb90a3cdf9f3047605d6a8aad49c22c44c
2016-01-04 20:46:25 -05:00
Corey Farrell 54a8f1a396 main/pbx: Move switch routines to pbx_switch.c.
This is the fifth patch in a series meant to reduce the bulk of pbx.c.
This moves ast_switch functions to their own source.

Change-Id: Ic2592a18a5c4d8a3c2dcf9786c9a6f650a8c628e
2016-01-04 19:20:35 -05:00
George Joseph 5e67e51c6a main/pbx: Move pbx_builtin dialplan applications to pbx_builtins.c
We joked about splitting pbx.c into multiple files but this first step was
fairly easy.  All of the pbx_builtin dialplan applications have been moved
into pbx_builtins.c and a new pbx_private.h file was added. load_pbx_builtins()
is called by asterisk.c just after load_pbx().

A few functions were renamed and are cross-exposed between the 2 source files.

Change-Id: I87066be3dbf7f5822942ac1449d98cc43fc7561a
2015-12-30 20:24:02 -07:00