[Asterisk-Dev] say.c cleanup

Luigi Rizzo rizzo at icir.org
Tue Nov 8 11:33:06 MST 2005


i am working on cleaning up asterisk/say.c and i need a bit
of advice.

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;
	};

where the various say_*_f fields are pointers to the language-specific
functions, and fallback to some default language for not-implemented
methods.
As a first step everything will be in one file, later maybe
i will implement languages as loadable modules.

The above list of function is derived from the current code. However,
i think there is a lot of redudancy that needs to be removed.  E.g.
all the say_date/time function right now are written from scratch,
whereas they could be implemented as calls to say_date_with_format_*()
with a specific format.  I have no idea on what is the spec for
ast_say_datetime_from_now(),

comments/suggestions anyone ?

also i would need people to review the code for the various
languages as submitting the change as a patch is simply hopeless,
basically the entire file is being rewritten/reorganized.

	cheers
	luigi



More information about the asterisk-dev mailing list