home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / TEKST / TXI2IPF1 / SOURCE.ZIP / gen / String_defs.h next >
Encoding:
C/C++ Source or Header  |  1993-02-05  |  2.3 KB  |  72 lines

  1. /*****************************************************************************
  2.  * $Id: String_defs.h,v 1.2 1993/02/05 09:07:20 ak Exp $
  3.  *****************************************************************************
  4.  * $Log: String_defs.h,v $
  5.  * Revision 1.2  1993/02/05  09:07:20  ak
  6.  * fcompare statt compare
  7.  *
  8.  * Revision 1.1.1.1  1993/02/04  15:17:42  ak
  9.  * Please Edit this file to contain the RCS log information
  10.  * to be associated with this file (please remove these lines)
  11.  *
  12.  * Revision 1.1  1993/02/04  15:17:40  ak
  13.  * Initial revision
  14.  *
  15.  *****************************************************************************/
  16.  
  17. // This may look like C code, but it is really -*- C++ -*-
  18. /*
  19. Copyright (C) 1988 Free Software Foundation
  20.     written by Doug Lea (dl@rocky.oswego.edu)
  21.  
  22. This file is part of the GNU C++ Library.  This library is free
  23. software; you can redistribute it and/or modify it under the terms of
  24. the GNU Library General Public License as published by the Free
  25. Software Foundation; either version 2 of the License, or (at your
  26. option) any later version.  This library is distributed in the hope
  27. that it will be useful, but WITHOUT ANY WARRANTY; without even the
  28. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  29. PURPOSE.  See the GNU Library General Public License for more details.
  30. You should have received a copy of the GNU Library General Public
  31. License along with this library; if not, write to the Free Software
  32. Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  33. */
  34.  
  35.  
  36. #ifndef _Stringdefs_h
  37. #define _Stringdefs_h 1
  38.  
  39. #include <Strng.h>
  40. #define StringCMP(a,b)    fcompare(a,b)
  41. #define StringHASH(x)    ((x[0] & 0xff) << 8 | (x[1] & 0xFF))
  42.  
  43. // equality operator
  44. #ifndef StringEQ
  45. #define StringEQ(a, b)  ((a) == (b))
  46. #endif
  47.  
  48. // less-than-or-equal
  49. #ifndef StringLE
  50. #define StringLE(a, b)  ((a) <= (b))
  51. #endif
  52.  
  53. // comparison : less-than -> < 0; equal -> 0; greater-than -> > 0
  54. #ifndef StringCMP
  55. #define StringCMP(a, b) ( ((a) <= (b))? (((a) == (b))? 0 : -1) : 1 )
  56. #endif
  57.  
  58. // hash function
  59. #ifndef StringHASH
  60. extern unsigned int hash(String&);
  61. #define StringHASH(x)  hash(x)
  62. #endif
  63.  
  64. // initial capacity for structures requiring one
  65.  
  66. #ifndef DEFAULT_INITIAL_CAPACITY
  67. #define DEFAULT_INITIAL_CAPACITY 100
  68. #endif
  69.  
  70.  
  71. #endif
  72.