Add license header (string module)
[scilab.git] / scilab / modules / string / src / c / isletter.c
1 /*--------------------------------------------------------------------------*/
2 /*
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) INRIA - Allan CORNET
5  * 
6  * This file must be used under the terms of the CeCILL.
7  * This source file is licensed as described in the file COPYING, which
8  * you should have received as part of this distribution.  The terms
9  * are also available at    
10  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
11  *
12  */
13
14 /*--------------------------------------------------------------------------*/
15 #include <string.h>
16 #include <ctype.h>
17 #include "isletter.h"
18 #include "MALLOC.h"
19 /*--------------------------------------------------------------------------*/
20 BOOL *isletter(char *input_string)
21 {
22         BOOL *returnedValues = NULL;
23         if (input_string)
24         {
25                 int i = 0;
26                 int length_input_string = (int)strlen(input_string);
27
28                 if (length_input_string > 0)
29                 {
30                         returnedValues = (BOOL*)MALLOC(sizeof(BOOL)*length_input_string);
31                         if (returnedValues)
32                         {
33                                 for (i = 0;i < length_input_string; i++)
34                                 {
35                                         if ( isalpha(input_string[i]) ) returnedValues[i] = TRUE;
36                                         else returnedValues[i] = FALSE;
37                                 }
38                         }
39                 }
40         }
41         return returnedValues;
42 }
43 /*--------------------------------------------------------------------------*/