[BACK]Return to dump_entry.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tic

Diff for /src/usr.bin/tic/dump_entry.c between version 1.10 and 1.11

version 1.10, 1999/12/12 04:49:19 version 1.11, 2000/01/02 21:48:13
Line 1 
Line 1 
 /*      $OpenBSD$       */  /*      $OpenBSD$       */
   
 /****************************************************************************  /****************************************************************************
  * Copyright (c) 1998,1999 Free Software Foundation, Inc.                   *   * Copyright (c) 1998-2000 Free Software Foundation, Inc.                   *
  *                                                                          *   *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *   * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *   * copy of this software and associated documentation files (the            *
Line 40 
Line 40 
 #include <termsort.c>           /* this C file is generated */  #include <termsort.c>           /* this C file is generated */
 #include <parametrized.h>       /* so is this */  #include <parametrized.h>       /* so is this */
   
 MODULE_ID("$From: dump_entry.c,v 1.43 1999/12/12 02:29:54 tom Exp $")  MODULE_ID("$From: dump_entry.c,v 1.44 2000/01/02 02:14:35 tom Exp $")
 #define INDENT                  8  
   
   #define INDENT                  8
 #define DISCARD(string) string = ABSENT_STRING  #define DISCARD(string) string = ABSENT_STRING
   #define PRINTF (void) printf
   
      static int tversion;       /* terminfo version */  static int tversion;            /* terminfo version */
      static int outform;        /* output format to use */  static int outform;             /* output format to use */
      static int sortmode;       /* sort mode to use */  static int sortmode;            /* sort mode to use */
      static int width = 60;     /* max line width for listings */  static int width = 60;          /* max line width for listings */
      static int column;         /* current column, limited by 'width' */  static int column;              /* current column, limited by 'width' */
      static int oldcol;         /* last value of column before wrap */  static int oldcol;              /* last value of column before wrap */
      static int tracelevel;     /* level of debug output */  static int tracelevel;          /* level of debug output */
      static bool pretty;        /* true if we format if-then-else strings */  static bool pretty;             /* true if we format if-then-else strings */
   
      static char *outbuf;       /* the output-buffer */  static char *outbuf;            /* the output-buffer */
      static size_t out_used;    /* ...its current length */  static size_t out_used;         /* ...its current length */
      static size_t out_size;    /* ...and its allocated length */  static size_t out_size;         /* ...and its allocated length */
   
 /* indirection pointers for implementing sort and display modes */  /* indirection pointers for implementing sort and display modes */
      static const int *bool_indirect, *num_indirect, *str_indirect;  static const int *bool_indirect, *num_indirect, *str_indirect;
      static NCURSES_CONST char *const *bool_names;  static NCURSES_CONST char *const *bool_names;
      static NCURSES_CONST char *const *num_names;  static NCURSES_CONST char *const *num_names;
      static NCURSES_CONST char *const *str_names;  static NCURSES_CONST char *const *str_names;
   
      static const char *separator, *trailer;  static const char *separator, *trailer;
   
 /* cover various ports and variants of terminfo */  /* cover various ports and variants of terminfo */
 #define V_ALLCAPS       0       /* all capabilities (SVr4, XSI, ncurses) */  #define V_ALLCAPS       0       /* all capabilities (SVr4, XSI, ncurses) */
Line 92 
Line 93 
 #endif  #endif
   
 #if NO_LEAKS  #if NO_LEAKS
      void  void
        _nc_leaks_dump_entry(void)  _nc_leaks_dump_entry(void)
 {  {
     if (outbuf != 0) {      if (outbuf != 0) {
         free(outbuf);          free(outbuf);
Line 328 
Line 329 
     return (FALSE);             /* pacify the compiler */      return (FALSE);             /* pacify the compiler */
 }  }
   
 static  static void
 void  
 append_output(const char *src)  append_output(const char *src)
 {  {
     if (src == 0) {      if (src == 0) {
Line 350 
Line 350 
     }      }
 }  }
   
 static  static void
 void  
 force_wrap(void)  force_wrap(void)
 {  {
     oldcol = column;      oldcol = column;
Line 359 
Line 358 
     column = INDENT;      column = INDENT;
 }  }
   
 static  static void
 void  
 wrap_concat(const char *src)  wrap_concat(const char *src)
 {  {
     int need = strlen(src);      int need = strlen(src);
Line 600 
Line 598 
                 }                  }
             }              }
   
             if (init_3string != 0              if (termcap_reset != ABSENT_STRING) {
                 && termcap_reset != 0                  if (init_3string != ABSENT_STRING
                 && !strcmp(init_3string, termcap_reset))                      && !strcmp(init_3string, termcap_reset))
                 DISCARD(init_3string);                      DISCARD(init_3string);
   
             if (reset_2string != 0                  if (reset_2string != ABSENT_STRING
                 && termcap_reset != 0                      && !strcmp(reset_2string, termcap_reset))
                 && !strcmp(reset_2string, termcap_reset))                      DISCARD(reset_2string);
                 DISCARD(reset_2string);              }
         }          }
   
         predval = pred(STRING, i);          predval = pred(STRING, i);
Line 766 
Line 764 
   
     if (((len = fmt_entry(tterm, pred, FALSE, infodump, numbers)) > critlen)      if (((len = fmt_entry(tterm, pred, FALSE, infodump, numbers)) > critlen)
         && limited) {          && limited) {
         (void) printf("# (untranslatable capabilities removed to fit entry within %d bytes)\n",          PRINTF("# (untranslatable capabilities removed to fit entry within %d bytes)\n",
             critlen);              critlen);
         if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers)) > critlen) {          if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers)) > critlen) {
             /*              /*
Line 775 
Line 773 
              */               */
             char *oldsgr = set_attributes;              char *oldsgr = set_attributes;
             set_attributes = ABSENT_STRING;              set_attributes = ABSENT_STRING;
             (void) printf("# (sgr removed to fit entry within %d bytes)\n",              PRINTF("# (sgr removed to fit entry within %d bytes)\n",
                 critlen);                  critlen);
             if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers)) > critlen) {              if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers)) > critlen) {
                 int oldversion = tversion;                  int oldversion = tversion;
   
                 tversion = V_BSD;                  tversion = V_BSD;
                 (void) printf("# (terminfo-only capabilities suppressed to fit entry within %d bytes)\n",                  PRINTF("# (terminfo-only capabilities suppressed to fit entry within %d bytes)\n",
                     critlen);                      critlen);
   
                 if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers))                  if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers))
Line 790 
Line 788 
                         "warning: %s entry is %d bytes long\n",                          "warning: %s entry is %d bytes long\n",
                         _nc_first_name(tterm->term_names),                          _nc_first_name(tterm->term_names),
                         len);                          len);
                     (void) printf(                      PRINTF(
                         "# WARNING: this entry, %d bytes long, may core-dump %s libraries!\n",                          "# WARNING: this entry, %d bytes long, may core-dump %s libraries!\n",
                         len, legend);                          len, legend);
                 }                  }

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11