diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-11-13 16:13:07 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-11-13 16:13:07 +0000 |
commit | 9e076dc898c23c4b6f88705c9fab822aa1a11056 (patch) | |
tree | d42acc06b937b300fa78849e43034c43d9efe96b /include | |
parent | 186326097344b69a46c5b7e775f2040b81fe1d74 (diff) |
Updates from char * to const char * + german syntax + enumeration (bug #2780)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4229 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rwxr-xr-x | include/asterisk/file.h | 30 | ||||
-rwxr-xr-x | include/asterisk/say.h | 54 |
2 files changed, 47 insertions, 37 deletions
diff --git a/include/asterisk/file.h b/include/asterisk/file.h index eb2c78e35..2f67fc23f 100755 --- a/include/asterisk/file.h +++ b/include/asterisk/file.h @@ -38,9 +38,9 @@ struct ast_filestream; * Adds a format to asterisk's format abilities. Fill in the fields, and it will work. For examples, look at some of the various format code. * returns 0 on success, -1 on failure */ -int ast_format_register(char *name, char *exts, int format, +int ast_format_register(const char *name, const char *exts, int format, struct ast_filestream * (*open)(int fd), - struct ast_filestream * (*rewrite)(int fd, char *comment), + struct ast_filestream * (*rewrite)(int fd, const char *comment), int (*write)(struct ast_filestream *, struct ast_frame *), int (*seek)(struct ast_filestream *, long offset, int whence), int (*trunc)(struct ast_filestream *), @@ -55,7 +55,7 @@ int ast_format_register(char *name, char *exts, int format, * Unregisters a format based on the name of the format. * Returns 0 on success, -1 on failure to unregister */ -int ast_format_unregister(char *name); +int ast_format_unregister(const char *name); //! Streams a file /*! @@ -66,7 +66,7 @@ int ast_format_unregister(char *name); * Also, it will stop any existing streams on the channel. * Returns 0 on success, or -1 on failure. */ -int ast_streamfile(struct ast_channel *c, char *filename, char *preflang); +int ast_streamfile(struct ast_channel *c, const char *filename, const char *preflang); //! Stops a stream /*! @@ -84,7 +84,7 @@ int ast_stopstream(struct ast_channel *c); * See if a given file exists in a given format. If fmt is NULL, any format is accepted. * Returns -1 if file does not exist, non-zero positive otherwise. */ -int ast_fileexists(char *filename, char *fmt, char *preflang); +int ast_fileexists(const char *filename, const char *fmt, const char *preflang); //! Renames a file /*! @@ -94,7 +94,7 @@ int ast_fileexists(char *filename, char *fmt, char *preflang); * Rename a given file in a given format, or if fmt is NULL, then do so for all * Returns -1 on failure */ -int ast_filerename(char *oldname, char *newname, char *fmt); +int ast_filerename(const char *oldname, const char *newname, const char *fmt); //! Deletes a file /*! @@ -102,7 +102,7 @@ int ast_filerename(char *oldname, char *newname, char *fmt); * \param format of the file * Delete a given file in a given format, or if fmt is NULL, then do so for all */ -int ast_filedelete(char *filename, char *fmt); +int ast_filedelete(const char *filename, const char *fmt); //! Copies a file /*! @@ -111,7 +111,7 @@ int ast_filedelete(char *filename, char *fmt); * \param fmt the format of the file * Copy a given file in a given format, or if fmt is NULL, then do so for all */ -int ast_filecopy(char *oldname, char *newname, char *fmt); +int ast_filecopy(const char *oldname, const char *newname, const char *fmt); //! Waits for a stream to stop or digit to be pressed /*! @@ -121,7 +121,7 @@ int ast_filecopy(char *oldname, char *newname, char *fmt); * Wait for a stream to stop or for any one of a given digit to arrive, Returns 0 * if the stream finishes, the character if it was interrupted, and -1 on error */ -char ast_waitstream(struct ast_channel *c, char *breakon); +char ast_waitstream(struct ast_channel *c, const char *breakon); //! Same as waitstream but allows stream to be forwarded or rewound /*! @@ -134,11 +134,11 @@ char ast_waitstream(struct ast_channel *c, char *breakon); * Wait for a stream to stop or for any one of a given digit to arrive, Returns 0 * if the stream finishes, the character if it was interrupted, and -1 on error */ -char ast_waitstream_fr(struct ast_channel *c, char *breakon, char *forward, char *rewind, int ms); +char ast_waitstream_fr(struct ast_channel *c, const char *breakon, const char *forward, const char *rewind, int ms); /* Same as waitstream, but with audio output to fd and monitored fd checking. Returns 1 if monfd is ready for reading */ -char ast_waitstream_full(struct ast_channel *c, char *breakon, int audiofd, int monfd); +char ast_waitstream_full(struct ast_channel *c, const char *breakon, int audiofd, int monfd); //! Starts reading from a file /*! @@ -154,7 +154,7 @@ char ast_waitstream_full(struct ast_channel *c, char *breakon, int audiofd, int * Please note, this is a blocking function. Program execution will not return until ast_waitstream completes it's execution. * Returns a struct ast_filestream on success, NULL on failure */ -struct ast_filestream *ast_readfile(char *filename, char *type, char *comment, int flags, int check, mode_t mode); +struct ast_filestream *ast_readfile(const char *filename, const char *type, const char *comment, int flags, int check, mode_t mode); //! Starts writing a file /*! @@ -170,7 +170,7 @@ struct ast_filestream *ast_readfile(char *filename, char *type, char *comment, i * Please note, this is a blocking function. Program execution will not return until ast_waitstream completes it's execution. * Returns a struct ast_filestream on success, NULL on failure */ -struct ast_filestream *ast_writefile(char *filename, char *type, char *comment, int flags, int check, mode_t mode); +struct ast_filestream *ast_writefile(const char *filename, const char *type, const char *comment, int flags, int check, mode_t mode); //! Writes a frame to a stream /*! @@ -196,7 +196,7 @@ int ast_closestream(struct ast_filestream *f); * \param preflang prefered language to use * Returns a ast_filestream pointer if it opens the file, NULL on error */ -struct ast_filestream *ast_openstream(struct ast_channel *chan, char *filename, char *preflang); +struct ast_filestream *ast_openstream(struct ast_channel *chan, const char *filename, const char *preflang); //! Opens stream for use in seeking, playing /*! @@ -205,7 +205,7 @@ struct ast_filestream *ast_openstream(struct ast_channel *chan, char *filename, * \param preflang prefered language to use * Returns a ast_filestream pointer if it opens the file, NULL on error */ -struct ast_filestream *ast_openvstream(struct ast_channel *chan, char *filename, char *preflang); +struct ast_filestream *ast_openvstream(struct ast_channel *chan, const char *filename, const char *preflang); //! Applys a open stream to a channel. /*! diff --git a/include/asterisk/say.h b/include/asterisk/say.h index e8b235e17..52197d4ea 100755 --- a/include/asterisk/say.h +++ b/include/asterisk/say.h @@ -23,23 +23,34 @@ extern "C" { #endif -//! says a number -/*! +/* says a number * \param chan channel to say them number on * \param num number to say on the channel * \param ints which dtmf to interrupt on * \param lang language to speak the number - * \param options set to 'f' for female, 'm' for masculine (used in portuguese) + * \param options set to 'f' for female, 'm' for male, 'c' for commune, 'n' for neuter, 'p' for plural * Vocally says a number on a given channel * Returns 0 on success, DTMF digit on interrupt, -1 on failure */ -int ast_say_number(struct ast_channel *chan, int num, char *ints, char *lang, char *options); +int ast_say_number(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options); /* Same as above with audiofd for received audio and returns 1 on ctrlfd being readable */ -int ast_say_number_full(struct ast_channel *chan, int num, char *ints, char *lang, char *options, int audiofd, int ctrlfd); +int ast_say_number_full(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd); -//! says digits -/*! +/* says an enumeration + * \param chan channel to say them enumeration on + * \param num number to say on the channel + * \param ints which dtmf to interrupt on + * \param lang language to speak the enumeration + * \param options set to 'f' for female, 'm' for male, 'c' for commune, 'n' for neuter, 'p' for plural + * Vocally says a enumeration on a given channel (first, sencond, third, forth, thirtyfirst, hundredth, ....) + * especially useful for dates and messages. says 'last' if num equals to INT_MAX + * Returns 0 on success, DTMF digit on interrupt, -1 on failure + */ +int ast_say_enumeration(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options); +int ast_say_enumeration_full(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd); + +/* says digits * \param chan channel to act upon * \param num number to speak * \param ints which dtmf to interrupt on @@ -47,11 +58,10 @@ int ast_say_number_full(struct ast_channel *chan, int num, char *ints, char *lan * Vocally says digits of a given number * Returns 0 on success, dtmf if interrupted, -1 on failure */ -int ast_say_digits(struct ast_channel *chan, int num, char *ints, char *lang); -int ast_say_digits_full(struct ast_channel *chan, int num, char *ints, char *lang, int audiofd, int ctrlfd); +int ast_say_digits(struct ast_channel *chan, int num, const char *ints, const char *lang); +int ast_say_digits_full(struct ast_channel *chan, int num, const char *ints, const char *lang, int audiofd, int ctrlfd); -//! says digits of a string -/*! +/* says digits of a string * \param chan channel to act upon * \param num string to speak * \param ints which dtmf to interrupt on @@ -59,22 +69,22 @@ int ast_say_digits_full(struct ast_channel *chan, int num, char *ints, char *lan * Vocally says the digits of a given string * Returns 0 on success, dtmf if interrupted, -1 on failure */ -int ast_say_digit_str(struct ast_channel *chan, char *num, char *ints, char *lang); -int ast_say_digit_str_full(struct ast_channel *chan, char *num, char *ints, char *lang, int audiofd, int ctrlfd); -int ast_say_character_str(struct ast_channel *chan, char *num, char *ints, char *lang); -int ast_say_character_str_full(struct ast_channel *chan, char *num, char *ints, char *lang, int audiofd, int ctrlfd); -int ast_say_phonetic_str(struct ast_channel *chan, char *num, char *ints, char *lang); -int ast_say_phonetic_str_full(struct ast_channel *chan, char *num, char *ints, char *lang, int audiofd, int ctrlfd); +int ast_say_digit_str(struct ast_channel *chan, const char *num, const char *ints, const char *lang); +int ast_say_digit_str_full(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd); +int ast_say_character_str(struct ast_channel *chan, const char *num, const char *ints, const char *lang); +int ast_say_character_str_full(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd); +int ast_say_phonetic_str(struct ast_channel *chan, const char *num, const char *ints, const char *lang); +int ast_say_phonetic_str_full(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd); -int ast_say_datetime(struct ast_channel *chan, time_t t, char *ints, char *lang); +int ast_say_datetime(struct ast_channel *chan, time_t t, const char *ints, const char *lang); -int ast_say_time(struct ast_channel *chan, time_t t, char *ints, char *lang); +int ast_say_time(struct ast_channel *chan, time_t t, const char *ints, const char *lang); -int ast_say_date(struct ast_channel *chan, time_t t, char *ints, char *lang); +int ast_say_date(struct ast_channel *chan, time_t t, const char *ints, const char *lang); -int ast_say_datetime_from_now(struct ast_channel *chan, time_t t, char *ints, char *lang); +int ast_say_datetime_from_now(struct ast_channel *chan, time_t t, const char *ints, const char *lang); -int ast_say_date_with_format(struct ast_channel *chan, time_t t, char *ints, char *lang, char *format, char *timezone); +int ast_say_date_with_format(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *timezone); #if defined(__cplusplus) || defined(c_plusplus) } |