Don't use is_int() since it doesn't link well on all platforms

Just create an normal API function in strings.h that does the same thing
just to be safe.

ASTERISK-17146


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@341379 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Terry Wilson
2011-10-19 07:38:52 +00:00
parent eae454ca3f
commit 8eb030a3a2
2 changed files with 20 additions and 2 deletions
+19
View File
@@ -871,6 +871,25 @@ int __attribute__((format(printf, 3, 4))) ast_str_append(
}
)
/*!
* \brief Check if a string is only digits
*
* \retval 1 The string contains only digits
* \retval 0 The string contains non-digit characters
*/
AST_INLINE_API(
int ast_check_digits(char *arg),
{
char *s;
for (s=arg; *s; s++) {
if (*s < '0' || *s > '9') {
return 0;
}
}
return 1;
}
)
/*!
* \brief Compute a hash value on a string
*