VC 1

File Edit Options Buffers Tools C Help                                          
 * Encodes the given VC dump, writing HTML to the given file pointer.           
int htmlencode(FILE *fp, VCDump *dump) {                                        
  int y,x,oldattr=-1;                                                           
  CA * cap=dump->ca;                                                            
  fputs("<pre>", fp);                                                           
  for (y=0; y<dump->h.ys; y++) {                                                
    for (x=0; x<dump->h.xs; x++) {                                              
      int ch=cap->ch, attr=cap->attr;                                           
      // if attribute changed, print appropriate tag                            
      if (oldattr != attr) {                                                    
        if (oldattr != -1) fputs("</span>", fp); // close old tag if open       
        fprintf(fp, "<span class=\"a%02x\">", attr);                            
      // replace unprintable characters with '?'                                
      if (ch & 0x7f < 0x20) ch='?';                                             
-uu-:---F1  vcsadump.c        (C CVS- Abbrev)--L122--C0--42%-------------