From 67a42d5a12b4b78bb1ac2a37fd6765c8892d9b7e Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Tue, 13 Feb 2007 22:07:28 +0000 Subject: [PATCH] mod_conference use void function pointer for the caller control function table instead of a void data pointer (c99 likes to keep them separate) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4245 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- .../mod_conference/mod_conference.c | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 3688888e48..ca1bb24e14 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -256,10 +256,12 @@ typedef enum { CONF_API_SUB_ARGS_AS_ONE } conference_fntype_t; +typedef void (*void_fn_t)(void); + /* API command parser */ typedef struct api_command { char *pname; - void *pfnapicmd; + void_fn_t pfnapicmd; conference_fntype_t fntype; char *psyntax; } api_command_t; @@ -3129,28 +3131,28 @@ static switch_status_t conf_api_sub_norecord(conference_obj_t *conference, switc /* API Interface Function sub-commands */ static api_command_t conf_api_sub_commands[] = { - {"list", &conf_api_sub_list, CONF_API_SUB_ARGS_SPLIT, " list [delim ]"}, - {"energy", &conf_api_sub_energy, CONF_API_SUB_MEMBER_TARGET, " energy []"}, - {"volume_in", &conf_api_sub_volume_in, CONF_API_SUB_MEMBER_TARGET, " volume_in []"}, - {"volume_out", &conf_api_sub_volume_out, CONF_API_SUB_MEMBER_TARGET, " volume_out []"}, - {"play", &conf_api_sub_play, CONF_API_SUB_ARGS_SPLIT, " play []"}, - {"say", &conf_api_sub_say, CONF_API_SUB_ARGS_AS_ONE, " say "}, - {"saymember", &conf_api_sub_saymember, CONF_API_SUB_ARGS_AS_ONE, " saymember "}, - {"stop", &conf_api_sub_stop, CONF_API_SUB_ARGS_SPLIT, " stop <[current|all|last]> []"}, - {"dtmf", &conf_api_sub_dtmf, CONF_API_SUB_MEMBER_TARGET, " dtmf <[member_id|all|last]> "}, - {"kick", &conf_api_sub_kick, CONF_API_SUB_MEMBER_TARGET, " kick <[member_id|all|last]>"}, - {"mute", &conf_api_sub_mute, CONF_API_SUB_MEMBER_TARGET, " mute <[member_id|all]|last>"}, - {"unmute", &conf_api_sub_unmute, CONF_API_SUB_MEMBER_TARGET, " unmute <[member_id|all]|last>"}, - {"deaf", &conf_api_sub_deaf, CONF_API_SUB_MEMBER_TARGET, " deaf <[member_id|all]|last>"}, - {"undeaf", &conf_api_sub_undeaf, CONF_API_SUB_MEMBER_TARGET, " undeaf <[member_id|all]|last>"}, - {"relate", &conf_api_sub_relate, CONF_API_SUB_ARGS_SPLIT, " relate [nospeak|nohear|clear]"}, - {"lock", &conf_api_sub_lock, CONF_API_SUB_ARGS_SPLIT, " lock"}, - {"unlock", &conf_api_sub_unlock, CONF_API_SUB_ARGS_SPLIT, " unlock"}, - {"dial", &conf_api_sub_dial, CONF_API_SUB_ARGS_SPLIT, " dial / "}, - {"bgdial", &conf_api_sub_bgdial, CONF_API_SUB_ARGS_SPLIT, " bgdial / "}, - {"transfer", &conf_api_sub_transfer, CONF_API_SUB_ARGS_SPLIT, " transfer [...]"}, - {"record", &conf_api_sub_record, CONF_API_SUB_ARGS_SPLIT, " record "}, - {"norecord", &conf_api_sub_norecord, CONF_API_SUB_ARGS_SPLIT, " norecord <[filename|all]>"}, + {"list", (void_fn_t)&conf_api_sub_list, CONF_API_SUB_ARGS_SPLIT, " list [delim ]"}, + {"energy", (void_fn_t)&conf_api_sub_energy, CONF_API_SUB_MEMBER_TARGET, " energy []"}, + {"volume_in", (void_fn_t)&conf_api_sub_volume_in, CONF_API_SUB_MEMBER_TARGET, " volume_in []"}, + {"volume_out", (void_fn_t)&conf_api_sub_volume_out, CONF_API_SUB_MEMBER_TARGET, " volume_out []"}, + {"play", (void_fn_t)&conf_api_sub_play, CONF_API_SUB_ARGS_SPLIT, " play []"}, + {"say", (void_fn_t)&conf_api_sub_say, CONF_API_SUB_ARGS_AS_ONE, " say "}, + {"saymember", (void_fn_t)&conf_api_sub_saymember, CONF_API_SUB_ARGS_AS_ONE, " saymember "}, + {"stop", (void_fn_t)&conf_api_sub_stop, CONF_API_SUB_ARGS_SPLIT, " stop <[current|all|last]> []"}, + {"dtmf", (void_fn_t)&conf_api_sub_dtmf, CONF_API_SUB_MEMBER_TARGET, " dtmf <[member_id|all|last]> "}, + {"kick", (void_fn_t)&conf_api_sub_kick, CONF_API_SUB_MEMBER_TARGET, " kick <[member_id|all|last]>"}, + {"mute", (void_fn_t)&conf_api_sub_mute, CONF_API_SUB_MEMBER_TARGET, " mute <[member_id|all]|last>"}, + {"unmute", (void_fn_t)&conf_api_sub_unmute, CONF_API_SUB_MEMBER_TARGET, " unmute <[member_id|all]|last>"}, + {"deaf", (void_fn_t)&conf_api_sub_deaf, CONF_API_SUB_MEMBER_TARGET, " deaf <[member_id|all]|last>"}, + {"undeaf", (void_fn_t)&conf_api_sub_undeaf, CONF_API_SUB_MEMBER_TARGET, " undeaf <[member_id|all]|last>"}, + {"relate", (void_fn_t)&conf_api_sub_relate, CONF_API_SUB_ARGS_SPLIT, " relate [nospeak|nohear|clear]"}, + {"lock", (void_fn_t)&conf_api_sub_lock, CONF_API_SUB_ARGS_SPLIT, " lock"}, + {"unlock", (void_fn_t)&conf_api_sub_unlock, CONF_API_SUB_ARGS_SPLIT, " unlock"}, + {"dial", (void_fn_t)&conf_api_sub_dial, CONF_API_SUB_ARGS_SPLIT, " dial / "}, + {"bgdial", (void_fn_t)&conf_api_sub_bgdial, CONF_API_SUB_ARGS_SPLIT, " bgdial / "}, + {"transfer", (void_fn_t)&conf_api_sub_transfer, CONF_API_SUB_ARGS_SPLIT, " transfer [...]"}, + {"record", (void_fn_t)&conf_api_sub_record, CONF_API_SUB_ARGS_SPLIT, " record "}, + {"norecord", (void_fn_t)&conf_api_sub_norecord, CONF_API_SUB_ARGS_SPLIT, " norecord <[filename|all]>"}, }; #define CONFFUNCAPISIZE (sizeof(conf_api_sub_commands)/sizeof(conf_api_sub_commands[0])) @@ -3194,7 +3196,7 @@ switch_status_t conf_api_dispatch(conference_obj_t *conference, switch_stream_ha } if (all) { - conference_member_itterator(conference, stream, conf_api_sub_commands[i].pfnapicmd, argv[argn+2]); + conference_member_itterator(conference, stream, (conf_api_member_cmd_t)conf_api_sub_commands[i].pfnapicmd, argv[argn+2]); } else if (last) { conference_member_t *member = NULL; conference_member_t *last_member = NULL;