do not export the tzlock and the list head, and introduce a new method,

ast_walk_indications(), to walk through the list of indications.
The new method returns an unlocked record, which is no different from the
behaviour of other existing methods in indications.c
(i.e. they all need to be fixed, with refcounts or some similar
method).

Note that ast_walk_indications() uses the pointer argument only as a
search key, so its implementation is completely safe.

In turn, this change allows the removal of AST_MUTEX_DEFINE_EXPORTED.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@16532 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Luigi Rizzo
2006-03-30 17:10:11 +00:00
parent 6d2fbc0b90
commit 48864ab877
4 changed files with 40 additions and 47 deletions

View File

@@ -59,29 +59,34 @@ struct tone_zone {
};
/* set the default tone country */
extern int ast_set_indication_country(const char *country);
int ast_set_indication_country(const char *country);
/* locate tone_zone, given the country. if country == NULL, use the default country */
extern struct tone_zone *ast_get_indication_zone(const char *country);
struct tone_zone *ast_get_indication_zone(const char *country);
/* locate a tone_zone_sound, given the tone_zone. if tone_zone == NULL, use the default tone_zone */
extern struct tone_zone_sound *ast_get_indication_tone(const struct tone_zone *zone, const char *indication);
struct tone_zone_sound *ast_get_indication_tone(const struct tone_zone *zone, const char *indication);
/* add a new country, if country exists, it will be replaced. */
extern int ast_register_indication_country(struct tone_zone *country);
int ast_register_indication_country(struct tone_zone *country);
/* remove an existing country and all its indications, country must exist */
extern int ast_unregister_indication_country(const char *country);
int ast_unregister_indication_country(const char *country);
/* add a new indication to a tone_zone. tone_zone must exist. if the indication already
* exists, it will be replaced. */
extern int ast_register_indication(struct tone_zone *zone, const char *indication, const char *tonelist);
int ast_register_indication(struct tone_zone *zone, const char *indication, const char *tonelist);
/* remove an existing tone_zone's indication. tone_zone must exist */
extern int ast_unregister_indication(struct tone_zone *zone, const char *indication);
int ast_unregister_indication(struct tone_zone *zone, const char *indication);
/* Start a tone-list going */
int ast_playtones_start(struct ast_channel *chan, int vol, const char* tonelist, int interruptible);
/*! Stop the tones from playing */
void ast_playtones_stop(struct ast_channel *chan);
/* support for walking through a list of indications */
struct tone_zone *ast_walk_indications(const struct tone_zone *cur);
#if 0
extern struct tone_zone *tone_zones;
extern ast_mutex_t tzlock;
#endif
#endif /* _ASTERISK_INDICATIONS_H */