[asterisk-dev] [asterisk-commits] mmichelson: branch mmichelson/forward-loop r87017 - in /team/mmichelson/forwa...

Kevin P. Fleming kpfleming at digium.com
Thu Oct 25 10:30:20 CDT 2007


SVN commits to the Asterisk project wrote:

> Added: team/mmichelson/forward-loop/include/asterisk/global_datastores.h
> URL: http://svn.digium.com/view/asterisk/team/mmichelson/forward-loop/include/asterisk/global_datastores.h?view=auto&rev=87017
> ==============================================================================
> --- team/mmichelson/forward-loop/include/asterisk/global_datastores.h (added)
> +++ team/mmichelson/forward-loop/include/asterisk/global_datastores.h Wed Oct 24 17:11:33 2007
> @@ -1,0 +1,21 @@
> +
> +#ifndef _ASTERISK_GLOBAL_DATASTORE_H
> +#define _ASTERISK_GLOBAL_DATASTORE_H
> +
> +#include "asterisk/channel.h"
> +
> +void dialed_interface_destroy(void *data);
> +void *dialed_interface_duplicate(void *data);
> +
> +const struct ast_datastore_info dialed_interface_info = {
> +	.type ="dialed-interface",
> +	.destroy = dialed_interface_destroy,
> +	.duplicate = dialed_interface_duplicate,
> +};
> +
> +struct ast_dialed_interface {
> +	char interface[80];
> +	AST_LIST_ENTRY(ast_dialed_interface) list;
> +};
> +
> +#endif

Since all this stuff is in the global namespace, it should be prefixed
with ast_ so as not to collide with anything defined locally in modules.
Also, I'd suggest prefixing the two callback functions with '__ast_',
signifying that they are for internal usage only and should not be
called directly.

Another possibility would be to move the definition of the
dialed_interface_info structure into global_datastores.c, and leaving
just an 'extern' declaration of it in this header file. This would allow
these two functions to then be static and local to that module.

-- 
Kevin P. Fleming
Director of Software Technologies
Digium, Inc. - "The Genuine Asterisk Experience" (TM)



More information about the asterisk-dev mailing list