Debian Codegraph @

addons/ooh323c/src/ooUtils.c

raw symbols SCIP
1 /*
2 * Copyright (C) 2004-2005 by Objective Systems, Inc.
3 *
4 * This software is furnished under an open source license and may be
5 * used and copied only in accordance with the terms of this license.
6 * The text of the license may generally be found in the root
7 * directory of this installation in the COPYING file. It
8 * can also be viewed online at the following URL:
9 *
10 * http://www.obj-sys.com/open/license.html
11 *
12 * Any redistributions of this file including modified versions must
13 * maintain this copyright notice.
14 *
15 *****************************************************************************/
16
17 #include "asterisk.h"
18 #include "asterisk/lock.h"
19 #include "ooUtils.h"
20 #include <ctype.h>
21
22 const char* ooUtilsGetText (OOUINT32 idx, const char** table, size_t tabsiz)
23 {
24 return (idx < tabsiz) ? table[idx] : "?";
25 }
26
27 OOBOOL ooUtilsIsStrEmpty (const char* str)
28 {
29 return (str == NULL || *str =='\0');
30 }
31
32
33 OOBOOL ooIsDialedDigit(const char* str)
34 {
35 if(str == NULL || *str =='\0') { return FALSE; }
36 while(*str != '\0')
37 {
38 if(!isdigit(*str) &&
39 *str != '#' && *str != '*' && *str != ',') { return FALSE; }
40 str++;
41 }
42 return TRUE;
43 }