f6b1cd42996f5ad01efa4d1cb3586e16922106ea
[scilab.git] / scilab / modules / string / src / c / isletter.c
1 /*--------------------------------------------------------------------------*/
2 /* Allan CORNET */
3 /* INRIA 2007 */
4 /*--------------------------------------------------------------------------*/
5 #include <string.h>
6 #include <ctype.h>
7 #include "isletter.h"
8 #include "MALLOC.h"
9 /*--------------------------------------------------------------------------*/
10 BOOL *isletter(char *input_string)
11 {
12         BOOL *returnedValues = NULL;
13         if (input_string)
14         {
15                 int i = 0;
16                 int length_input_string = (int)strlen(input_string);
17
18                 if (length_input_string > 0)
19                 {
20                         returnedValues = (BOOL*)MALLOC(sizeof(BOOL)*length_input_string);
21                         if (returnedValues)
22                         {
23                                 for (i = 0;i < length_input_string; i++)
24                                 {
25                                         if ( isalpha(input_string[i]) ) returnedValues[i] = TRUE;
26                                         else returnedValues[i] = FALSE;
27                                 }
28                         }
29                 }
30         }
31         return returnedValues;
32 }
33 /*--------------------------------------------------------------------------*/