/home/doxygen/libascend/compiler/cmpfunc.h

Go to the documentation of this file.
00001 /*
00002  *  ASCEND comparison functions of various sorts.
00003  *  by Ben Allen
00004  *  Created 9/16/96
00005  *  Version: $Revision: 1.6 $
00006  *  Version control file: $RCSfile: cmpfunc.h,v $
00007  *  Date last modified: $Date: 1997/07/18 12:28:32 $
00008  *  Last modified by: $Author: mthomas $
00009  *
00010  *  This file is part of the Ascend Language Interpreter.
00011  *
00012  *  Copyright (C) 1997 Carnegie Mellon University
00013  *
00014  *  The Ascend Language Interpreter is free software; you can redistribute
00015  *  it and/or modify it under the terms of the GNU General Public License as
00016  *  published by the Free Software Foundation; either version 2 of the
00017  *  License, or (at your option) any later version.
00018  *
00019  *  The Ascend Language Interpreter is distributed in hope that it will be
00020  *  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
00021  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00022  *  General Public License for more details.
00023  *
00024  *  You should have received a copy of the GNU General Public License
00025  *  along with the program; if not, write to the Free Software Foundation,
00026  *  Inc., 675 Mass Ave, Cambridge, MA 02139 USA.  Check the file named
00027  *  COPYING.
00028  */
00029 
00049 #ifndef ASC_CMPFUNC_H
00050 #define ASC_CMPFUNC_H
00051 
00052 #include "compiler.h"
00053 
00058 /* REMINDER: strcmp("abc","fcd") --> -1 */
00059 
00060 /*
00061  *  When used with a sort function, these yield a list ordered in
00062  *  increasing value.
00063  *  if comparing symbols, use CmpSymchar for maximum speed or
00064  *  strcmp(SCP(sc1),SCP(sc2));
00065  */
00066 
00067 ASC_DLLSPEC int CmpSymchar(symchar *s1, symchar *s2);
00082 extern int CmpPtrs(const void *p1, const void *p2);
00094 ASC_DLLSPEC int CmpRealPtrs(const void *p1, const void *p2);
00105 /*
00106  *  Comparison functions for instance pointers.
00107  *  All rather similar, but we may decide to change the comparison
00108  *  methods later, so each has its own function.
00109  */
00110 
00111 #ifndef NDEBUG
00112 #define CmpParents CmpRealPtrs
00113 #else
00114 #define CmpParents CmpParentsF
00115 #endif
00116 
00120 extern int CmpParentsF(CONST struct Instance *i1, CONST struct Instance *i2);
00131 #ifndef NDEBUG
00132 #define CmpRelations CmpRealPtrs
00133 #else
00134 #define CmpRelations CmpRelationsF
00135 #endif
00136 
00140 extern int CmpRelationsF(CONST struct Instance *i1, CONST struct Instance *i2);
00151 #ifndef NDEBUG
00152 #define CmpLogRelations CmpRealPtrs
00153 #else
00154 #define CmpLogRelations CmpLogRelationsF
00155 #endif
00156 
00160 extern int CmpLogRelationsF(CONST struct Instance *i1, CONST struct Instance *i2);
00171 #ifndef NDEBUG
00172 #define CmpWhens CmpRealPtrs
00173 #else
00174 #define CmpWhens CmpWhensF
00175 #endif
00176 
00180 extern int CmpWhensF(CONST struct Instance *i1, CONST struct Instance *i2);
00191 #ifdef ASC_INSTANCE_TYPES_H
00192 
00193 extern int CmpIntIndex(CONST struct ArrayChild *a, CONST struct ArrayChild *b);
00206 extern int CmpStrIndex(CONST struct ArrayChild *a, CONST struct ArrayChild *b);
00220 #endif  /* INSTANCE_TYPES_H_SEEN__ */
00221 
00222 /*
00223  *  When used with a sort function, these yield a list ordered in
00224  *  decreasing value.
00225  */
00226 
00227 extern int CmpPtrsReverse(void *p1, void *p2);
00239 /* @} */
00240 
00241 #endif  /* ASC_CMPFUNC_H */
00242 

Generated on Thu Jul 17 04:00:10 2008 for libascend by  doxygen 1.5.1