[BACK]Return to mdocterm.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/Attic/mdocterm.c between version 1.44 and 1.45

version 1.44, 2009/03/15 07:18:10 version 1.45, 2009/03/15 10:34:11
Line 203  main(int argc, char *argv[])
Line 203  main(int argc, char *argv[])
         termp.offset = termp.col = 0;          termp.offset = termp.col = 0;
         termp.flags = TERMP_NOSPACE;          termp.flags = TERMP_NOSPACE;
         termp.symtab = termsym_ascii;          termp.symtab = termsym_ascii;
         termp.enc = TERMENC_NROFF;  
   
         nroff.termp = &termp;          nroff.termp = &termp;
   
Line 247  static int
Line 246  static int
 optsopt(struct termp *p, char *arg)  optsopt(struct termp *p, char *arg)
 {  {
         char            *v;          char            *v;
         char            *toks[] = { "ansi", "nopunt", NULL };          char            *toks[] = { "nopunt", NULL };
   
         while (*arg)          while (*arg)
                 switch (getsubopt(&arg, toks, &v)) {                  switch (getsubopt(&arg, toks, &v)) {
                 case (0):                  case (0):
                         p->enc = TERMENC_ANSI;  
                         break;  
                 case (1):  
                         p->iflags |= TERMP_NOPUNT;                          p->iflags |= TERMP_NOPUNT;
                         break;                          break;
                 default:                  default:
Line 378  flushln(struct termp *p)
Line 374  flushln(struct termp *p)
   
                 /* LINTED */                  /* LINTED */
                 for (j = i, vsz = 0; j < p->col; j++) {                  for (j = i, vsz = 0; j < p->col; j++) {
                         if (isspace((u_char)p->buf[j])) {                          if (isspace((u_char)p->buf[j]))
                                 break;                                  break;
                         } else if (27 == p->buf[j]) {                          else if (8 == p->buf[j])
                                 assert(TERMENC_ANSI == p->enc);  
                                 assert(j + 5 <= p->col);  
                                 j += 4;  
                         } else if (8 == p->buf[j]) {  
                                 assert(TERMENC_NROFF == p->enc);  
                                 assert(j + 2 <= p->col);  
                                 j += 1;                                  j += 1;
                         } else                          else
                                 vsz++;                                  vsz++;
                 }                  }
   
Line 858  pword(struct termp *p, const char *word, size_t len)
Line 848  pword(struct termp *p, const char *word, size_t len)
          * before the word.           * before the word.
          */           */
   
         if (TERMENC_ANSI == p->enc && TERMP_STYLE & p->flags) {  
                 if (TERMP_BOLD & p->flags) {  
                         chara(p, 27);  
                         stringa(p, "[01m", 4);  
                 }  
                 if (TERMP_UNDER & p->flags) {  
                         chara(p, 27);  
                         stringa(p, "[04m", 4);  
                 }  
                 if (TERMP_RED & p->flags) {  
                         chara(p, 27);  
                         stringa(p, "[31m", 4);  
                 }  
                 if (TERMP_GREEN & p->flags) {  
                         chara(p, 27);  
                         stringa(p, "[32m", 4);  
                 }  
                 if (TERMP_YELLOW & p->flags) {  
                         chara(p, 27);  
                         stringa(p, "[33m", 4);  
                 }  
                 if (TERMP_BLUE & p->flags) {  
                         chara(p, 27);  
                         stringa(p, "[34m", 4);  
                 }  
                 if (TERMP_MAGENTA & p->flags) {  
                         chara(p, 27);  
                         stringa(p, "[35m", 4);  
                 }  
                 if (TERMP_CYAN & p->flags) {  
                         chara(p, 27);  
                         stringa(p, "[36m", 4);  
                 }  
         }  
   
         for (i = 0; i < len; i++) {          for (i = 0; i < len; i++) {
                 if ('\\' == word[i]) {                  if ('\\' == word[i]) {
                         pescape(p, word, &i, len);                          pescape(p, word, &i, len);
                         continue;                          continue;
                 }                  }
   
                 if (TERMENC_NROFF == p->enc &&                  if (TERMP_STYLE & p->flags) {
                                 TERMP_STYLE & p->flags) {  
                         if (TERMP_BOLD & p->flags) {                          if (TERMP_BOLD & p->flags) {
                                 chara(p, word[i]);                                  chara(p, word[i]);
                                 chara(p, 8);                                  chara(p, 8);
Line 912  pword(struct termp *p, const char *word, size_t len)
Line 866  pword(struct termp *p, const char *word, size_t len)
                 }                  }
   
                 chara(p, word[i]);                  chara(p, word[i]);
         }  
   
         if (TERMENC_ANSI == p->enc && TERMP_STYLE & p->flags) {  
                 chara(p, 27);  
                 stringa(p, "[00m", 4);  
         }          }
 }  }
   

Legend:
Removed from v.1.44  
changed lines
  Added in v.1.45

CVSweb