teapot-spreadsheet/src/common/default.h
Glen Whitney 96079b210e Make tpa the default file format for Teapot
There turned out to be one blocking technical issue for full adpotion of
  tpa format, and that was the fact that the printed representation of
  floating values inside the tpa file might not reproduce the same double
  when read. This change therefore introduces the "hexact" floating point
  format, based on the the %La format string, which produces a hex
  representation with exact round trips. While working on this, it was
  convenient to add a new representation "compact" which is basically the
  shorter of decimal and scientific representations, without trailing zeros.
  This is now the default float format, but of course one can select decimal
  or scientific formats to restore prior appearance. However, full-precision
  compact format is now the (only) format for editing cell contents, as it
  is accurate and efficient. Of course you can enter floating point values
  in any format you like when typing in a formula.

  The addition of several new floating point options overloaded the menus
  in terminal teapot, so this change also revamps those menus slightly,
  including eliminating the unused MenuChoice struct, and just specifying menus
  with an array of strings.

  Closes #63.
2019-08-24 09:58:46 -07:00

42 lines
950 B
C

#ifndef DEFAULT_H
#define DEFAULT_H
#include <stdlib.h>
/* default width of a column */
#define DEF_COLUMNWIDTH 12
/* default precision of a printed value */
/* Since the default format now counts significant figures
rather than digits after the decimal, bumping this to 3
*/
#define DEF_PRECISION 3
/* default is compact notation for floating point numbers */
#define DEF_FLOATFORM FLT_COMPACT
/* character attribute for cell and row numbers */
#define DEF_NUMBER A_BOLD
/* character attribute for cell cursor */
#define DEF_CELLCURSOR A_REVERSE
/* character attribute for selected menu choice */
#define DEF_MENU A_REVERSE
/* maximum number of sort keys */
#define MAX_SORTKEYS 8
/* maximum number of eval() nesting */
#define MAX_EVALNEST 32
/* define if testing with EletricFence */
#ifdef THE_ELECTRIC_FENCE
#undef malloc
#undef free
#undef realloc
#undef calloc
#endif
#endif