/* Time-stamp: <97/01/23 15:35:45 john> */

/* 
# Purpose: Defines the style structure (for remembering how to output things), and macros to output links in different styles from the current one
 */

struct style {
  char *output_mode;
  int output_code;
  int graphics;
  int edit;
  int hide_edit;
  int all_edit_links;
  int detail;
  int pictures;
  int verbose;
  int debug;
  int unvetted;
  int hide_unvetted;
  int suppress_auto_graphics;
  int helpful;
  int parts;
  int browser_features;
  char *extra;
  char *special;
  char *special_page_start;
  char *special_page_end;
  int forced_date;
  int month;
  int day;
  int hour;
} STYLE;

#define HEAD_PART 1
#define BODY_PART 2

#define BROWSER_HAS_ALIGN           1
#define BROWSER_JUMP_IN_TABLES      2
#define BROWSER_ANTI_ALIAS          4
#define BROWSER_GRAPHICAL           8
#define BROWSER_CELL_COLOURS     0x10
#define BROWSER_RECURSIVE_TABLES 0x20

#define OUTPUT_UNKNOWN  0
#define OUTPUT_HTML_PRE 1
#define OUTPUT_HTML     2
#define OUTPUT_PARSED   3
#define OUTPUT_RAW      4
#define OUTPUT_GRID     5
#define OUTPUT_TEXT     6
#define OUTPUT_VRML2    7
#define OUTPUT_VRML     8
#define OUTPUT_DATA     9

#define Link_In_Other_Style(_script_,_type_,_name_,_style_,_ftype_,_fname_,_fvalue_,_visible_,_extrakey_,_extraval_) \
{ \
  _ftype_ old_field = (_style_)->_fname_; \
  (_style_)->_fname_ = (_fvalue_); \
  link_in_style((_script_), (_type_), (_name_), (_style_), (_visible_), NULL, (_extrakey_), (_extraval_)); \
  (_style_)->_fname_ = old_field; \
}

#define Flip_Style(_script_,_type_,_name_,_style_,_fname_,_on_,_off_) \
{ \
  int current = (_style_)->_fname_; \
  printf("  "); \
  if (current) \
    { \
      Link_In_Other_Style(_script_,_type_,_name_,_style_,int,_fname_,0,_off_, NULL, NULL); \
    } else { \
      Link_In_Other_Style(_script_,_type_,_name_,_style_,int,_fname_,1,_on_, NULL, NULL); \
    } \
  printf("\n"); \
}

/* end of style.h */
