#include "exprpriv.h"
#include "exprmem.h"
+#include "switch_utils.h"
/* Data structure used by parser */
typedef struct _exprToken {
default:
{
if (!comment) {
- if (expr[pos] == '.' || isdigit(expr[pos])) {
+ if (expr[pos] == '.' || switch_isdigit(expr[pos])) {
/* Value */
start = pos;
/* Find digits before a period */
- while (isdigit(expr[pos]))
+ while (switch_isdigit(expr[pos]))
pos++;
/* Find a period */
pos++;
/* Find digits after a period */
- while (isdigit(expr[pos]))
+ while (switch_isdigit(expr[pos]))
pos++;
/* pos is AFTER last item, back up */
list[tpos].data.val = (EXPRTYPE) atof(buf);
tpos++;
}
- } else if (expr[pos] == '_' || isalpha(expr[pos])) {
+ } else if (expr[pos] == '_' || switch_isalpha(expr[pos])) {
/* Identifier */
start = pos;
/* Find rest of identifier */
- while (expr[pos] == '_' || isalnum(expr[pos]))
+ while (expr[pos] == '_' || switch_isalnum(expr[pos]))
pos++;
/* pos is AFTER last item, back up */
strcpy(list[tpos].data.str, buf);
tpos++;
}
- } else if (isspace(expr[pos])) {
+ } else if (switch_isspace(expr[pos])) {
/* Spaces are ignored, do nothing */
} else {
/* Unknown */
#include "exprincl.h"
#include "exprpriv.h"
+#include "switch_utils.h"
/* Return the version number */
return 0;
/* First must be letter or underscore */
- if (isalpha(*name) || *name == '_')
+ if (switch_isalpha(*name) || *name == '_')
name++; /* Point to next letter */
else
return 0; /* Not letter or underscore, maybe empty */
/* others can be letter, number, or underscore */
- while (isalnum(*name) || *name == '_')
+ while (switch_isalnum(*name) || *name == '_')
name++;
/* When the while breaks out, we should be at the end */