[Asterisk-Dev] say.c cleanup

Chih-Wei Huang cwhuang at citron.com.tw
Tue Nov 8 19:11:39 MST 2005


Luigi Rizzo wrote:
> i am working on cleaning up asterisk/say.c and i need a bit
> of advice.

Nice work! It will make say.c be more readable...

> The idea is to provide, for each supported language, a descriptor
> with roughly these fields:
> 	struct _lang_sw {
> 	    char *language;
> 
> 	    int initialized;            /* 0 at beginning */
> 	    say_number_full_f       *say_number_full;
> 	    say_enumeration_full_f  *say_enumeration_full;
> 	    say_date_f              *say_date;
> 	    say_date_with_format_f  *say_date_with_format;
> 	    say_time_f              *say_time;
> 	    say_datetime_f          *say_datetime;
> 	    say_datetime_from_now_f *say_datetime_from_now;
> 	};
deleted
> comments/suggestions anyone ?

It should be able to support multiple language codes in
one descriptor.
For example, currently say_*_tw only supports code "tw" (Taiwanese).
It should be able to support "zh"(Chinese code) or even
"cn"(China Mainland).

In a summary, the supported language/country/code codes should
be a list of strings.
So maybe the first field of struct _lang_sw should be changed to

char **languages;



More information about the asterisk-dev mailing list