Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals

strcomp.c

Go to the documentation of this file.
00001 /************************************************************************* 00002 * $Id: strcomp.c,v 1.1 2005/09/09 08:22:56 bellet Exp $ 00003 ************************************************************************** 00004 This software is governed by the CeCILL license under French law and 00005 abiding by the rules of distribution of free software. You can use, 00006 modify and/ or redistribute the software under the terms of the CeCILL 00007 license as circulated by CEA, CNRS and INRIA at the following URL 00008 "http://www.cecill.info". 00009 00010 As a counterpart to the access to the source code and rights to copy, 00011 modify and redistribute granted by the license, users are provided only 00012 with a limited warranty and the software's author, the holder of the 00013 economic rights, and the successive licensors have only limited 00014 liability. 00015 00016 In this respect, the user's attention is drawn to the risks associated 00017 with loading, using, modifying and/or developing or reproducing the 00018 software by the user in light of its specific status of free software, 00019 that may mean that it is complicated to manipulate, and that also 00020 therefore means that it is reserved for developers and experienced 00021 professionals having in-depth computer knowledge. Users are therefore 00022 encouraged to load and test the software's suitability as regards their 00023 requirements in conditions enabling the security of their systems and/or 00024 data to be ensured and, more generally, to use and operate it in the 00025 same conditions as regards security. 00026 00027 The fact that you are presently reading this means that you have had 00028 knowledge of the CeCILL license and that you accept its terms. 00029 00030 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de 00031 l'Image). All rights reserved. See License.txt for details. 00032 00033 Version 1.0 05/09/2005 00034 *************************************************************************/ 00035 00036 /* 00037 * Comparaison de chaines de caracteres sans tenir compte de 00038 * la casse. 00039 */ 00040 #include "idstr.h" 00041 00042 #define UP(c) (('a'<=(c) && 'z'>=(c))?((c)+'A'-'a'):(c)) 00043 00044 /* 00045 * FUNCTION DESCRIPTION ************************************************** 00046 * 00047 * IdStrCmpNoCase (fonction) 00048 * 00049 * RESUME: Meme role que strcmp, sans tenir compte de la casse (maj./min.). 00050 * 00051 * DESCRIPTION: Meme role que strcmp, sans tenir compte de la casse (maj./min.). 00052 * 00053 * SYNTAXE: int comp = IdStrCmpNoCase (char * a, char * b); 00054 * 00055 * RETOUR: type : comp 00056 * role : code de comparaison : 0: a=b >0: a>b <0: a<b 00057 * 00058 * PARAMETRES: 00059 * nom : a, b 00060 * type : char * 00061 * role : chaines a comparer. 00062 * 00063 * FICHIER: strcomp.c 00064 * 00065 * ******************************************************** END DESCRIPTION 00066 */ 00067 00068 int 00069 IdStrCmpNoCase(char *s1, char *s2) 00070 { 00071 do { 00072 int c; 00073 if ((c = UP(*s1) - UP(*s2)) != 0) 00074 return c; 00075 s1++; 00076 s2++; 00077 } while ((*s1) || (*s2)); 00078 return 0; 00079 } 00080 00081 #undef UP

Generated on Wed Oct 19 09:28:34 2005 for SIMRI3D by doxygen 1.3.7