Add 'const' qualifier to character string argument to keypad facility API calls

These API calls do not modify the string supplied, and should not be allowed to modify it, so this patch adds a 'const' qualifier to that argument to allow the compiler to enforce this restriction (and allow callers of the API that already have a 'const' pointer to be able to pass it to this API).



git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@798 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
Kevin P. Fleming 2009-05-13 15:17:08 +00:00
parent 5484712af0
commit 39f7f72d8f
4 changed files with 4 additions and 4 deletions

View File

@ -573,7 +573,7 @@ int pri_information(struct pri *pri, q931_call *call, char digit);
#define PRI_KEYPAD_FACILITY_TX
/* Send a keypad facility string of digits */
int pri_keypad_facility(struct pri *pri, q931_call *call, char *digits);
int pri_keypad_facility(struct pri *pri, q931_call *call, const char *digits);
/* Answer the incomplete(call without called number) call on the given channel.
Set non-isdn to non-zero if you are not connecting to ISDN equipment */

2
pri.c
View File

@ -515,7 +515,7 @@ int pri_information(struct pri *pri, q931_call *call, char digit)
return q931_information(pri, call, digit);
}
int pri_keypad_facility(struct pri *pri, q931_call *call, char *digits)
int pri_keypad_facility(struct pri *pri, q931_call *call, const char *digits)
{
if (!pri || !call || !digits || !digits[0])
return -1;

View File

@ -437,7 +437,7 @@ extern int q931_setup_ack(struct pri *pri, q931_call *call, int channel, int non
extern int q931_information(struct pri *pri, q931_call *call, char digit);
extern int q931_keypad_facility(struct pri *pri, q931_call *call, char *digits);
extern int q931_keypad_facility(struct pri *pri, q931_call *call, const char *digits);
extern int q931_connect(struct pri *pri, q931_call *call, int channel, int nonisdn);

2
q931.c
View File

@ -2767,7 +2767,7 @@ int q931_information(struct pri *pri, q931_call *c, char digit)
static int keypad_facility_ies[] = { Q931_IE_KEYPAD_FACILITY, -1 };
int q931_keypad_facility(struct pri *pri, q931_call *call, char *digits)
int q931_keypad_facility(struct pri *pri, q931_call *call, const char *digits)
{
libpri_copy_string(call->keypad_digits, digits, sizeof(call->keypad_digits));
return send_message(pri, call, Q931_INFORMATION, keypad_facility_ies);