1 /* CalculiX - A 3-dimensional finite element program */
2 /* Copyright (C) 1998-2021 Guido Dhondt */
3
4 /* This program is free software; you can redistribute it and/or */
5 /* modify it under the terms of the GNU General Public License as */
6 /* published by the Free Software Foundation(version 2); */
7 /* */
8
9 /* This program is distributed in the hope that it will be useful, */
10 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
11 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
12 /* GNU General Public License for more details. */
13
14 /* You should have received a copy of the GNU General Public License */
15 /* along with this program; if not, write to the Free Software */
16 /* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
17
18 #include <stdlib.h>
19 #include <math.h>
20 #include <stdio.h>
21 #include <string.h>
22 #include "CalculiX.h"
23
strcmp1(const char * s1,const char * s2)24 ITG strcmp1(const char *s1, const char *s2)
25 {
26 ITG a,b;
27
28 do {
29 a=*s1++;
30 b=*s2++;
31
32 /* the statement if((a=='\0')||(b=='\0')) has been treated separately
33 in order to avoid the first field (s1) to be defined one longer
34 than required; s1 is assumed to be a variable field, s2 is
35 assumed to be a fixed string */
36
37 if(b=='\0'){
38 a='\0';
39 b='\0';
40 break;
41 }
42 if(a=='\0'){
43 a='\0';
44 b='\0';
45 break;
46 }
47 }while(a==b);
48 return(a-b);
49 }
50
51