* This function will check integer. * * @param strvalue string * * @return true or false */
| 21 | * @return true or false |
| 22 | */ |
| 23 | rt_bool_t msh_isint(char *strvalue) |
| 24 | { |
| 25 | if ((RT_NULL == strvalue) || ('\0' == strvalue[0])) |
| 26 | { |
| 27 | return RT_FALSE; |
| 28 | } |
| 29 | if (('+' == *strvalue) || ('-' == *strvalue)) |
| 30 | { |
| 31 | strvalue++; |
| 32 | } |
| 33 | forstrloop(strvalue) |
| 34 | { |
| 35 | if (!isdigit((int)(*strvalue))) |
| 36 | { |
| 37 | return RT_FALSE; |
| 38 | } |
| 39 | } |
| 40 | return RT_TRUE; |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * This function will check hex. |
no outgoing calls
no test coverage detected