home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d172 / spiff.lha / Spiff / tol.h < prev    next >
C/C++ Source or Header  |  1988-11-22  |  2KB  |  65 lines

  1. /*                        Copyright (c) 1988 Bellcore
  2. **                            All Rights Reserved
  3. **       Permission is granted to copy or use this program, EXCEPT that it
  4. **       may not be sold for profit, the copyright notice must be reproduced
  5. **       on copies, and credit should be given to Bellcore where it is due.
  6. **       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  7. */
  8.  
  9. #include "float.h"
  10.  
  11. #ifndef T_INCLUDED
  12. /*
  13. **    values for tol_type
  14. */
  15. #define T_ABSOLUTE         0
  16. #define T_RELATIVE         1
  17. #define T_IGNORE        2
  18.  
  19. typedef struct _T_tstr{
  20.     int tol_type;        /* one of the above */
  21.     F_float flo_tol;    /* tolerance is expressed in
  22.                     terms of a floating point value */
  23.     struct _T_tstr *next;
  24. } _T_struct, *T_tol;
  25.  
  26. #define _T_TOLMAX    10    /* number of tolerances that can
  27.                     be in effect at one time */
  28.  
  29. #define _T_ADEF        "1e-10"    /* default absolute tolerance */
  30. #define _T_RDEF        "1e-10"    /* default relative tolerance */
  31.  
  32. extern T_tol T_gettol();
  33. extern void T_clear_tols();
  34. extern void T_initdefault();
  35. extern void T_setdef();
  36. extern void T_tolline();
  37. extern T_tol T_picktol();
  38.  
  39. #define T_gettype(x)    (x->tol_type)
  40. #define T_getfloat(x)    (x->flo_tol)
  41. #define T_getnext(x)    (x->next)
  42.  
  43. #define T_settype(x,y)    (x->tol_type = y)
  44. #define T_setfloat(x,y)    (x->flo_tol = y)
  45. #define T_setnext(x,y)    (x->next = y)
  46.  
  47. #define _T_null        ((T_tol) 0)
  48. #define T_isnull(x)    ((x) == _T_null)
  49.  
  50. extern T_tol _T_gtol;
  51. extern void _T_addtol();
  52. extern void _T_appendtols();
  53.  
  54. /*
  55. **    routines for building the global tolerance list
  56. */
  57. #define T_defatol(x)    _T_addtol(&_T_gtol,T_ABSOLUTE,x)
  58. #define T_defrtol(x)    _T_addtol(&_T_gtol,T_RELATIVE,x)
  59. #define T_defitol()    _T_addtol(&_T_gtol,T_IGNORE,(char*)NULL)
  60.  
  61. #define _T_SEPCHAR    ';'
  62.  
  63. #define T_INCLUDED
  64. #endif
  65.