]> git.ipfire.org Git - thirdparty/asterisk.git/commit
sorcery: Add API to insert/remove a wizard to/from an object type's list 94/394/7
authorGeorge Joseph <george.joseph@fairview5.com>
Tue, 5 May 2015 20:32:08 +0000 (14:32 -0600)
committerGeorge Joseph <george.joseph@fairview5.com>
Tue, 12 May 2015 16:03:54 +0000 (11:03 -0500)
commit637c8f065efead83f56455a4ab45785e34ed56fb
treed23db259730f3abe1444fe5b2eafe0a00646f3b2
parent8523a5ed099bc3d2a99dc232e23a877f32fc6453
sorcery: Add API to insert/remove a wizard to/from an object type's list

Currently you can 'apply' a wizard to an object type but the wizard
always goes at the end of the object type's wizard list.  This patch
adds a new ast_sorcery_insert_wizard_mapping function that allows
you to insert a wizard anyplace in the list.  I.E.  You could
add a caching wizard to an object type and place it before all
wizards.

ast_sorcery_get_wizard_mapping_count and
ast_sorcery_get_wizard_mapping were added to allow examination
of the mapping list.

ast_sorcery_remove_mapping was added to remove a mapping by name.

As part of this patch, the object type's wizard list was converted
from an ao2_container to an AST_VECTOR_RW.

A new test was added to test_sorcery for this capability.

ASTERISK-25044 #close

Change-Id: I9d2469a9296b2698082c0989e25e6848dc403b57
include/asterisk/sorcery.h
main/sorcery.c
tests/test_sorcery.c