Annotation of 43BSD/usr.lib/libln/allprint.c, revision 1.1.1.1

1.1       root        1: /*     @(#)allprint.c  4.1     12/25/82        */
                      2: 
                      3: # include <stdio.h>
                      4: allprint(c)
                      5:   char c; {
                      6:        extern FILE *yyout;
                      7:        switch(c){
                      8:                case '\n':
                      9:                        fprintf(yyout,"\\n");
                     10:                        break;
                     11:                case '\t':
                     12:                        fprintf(yyout,"\\t");
                     13:                        break;
                     14:                case '\b':
                     15:                        fprintf(yyout,"\\b");
                     16:                        break;
                     17:                case ' ':
                     18:                        fprintf(yyout,"\\\bb");
                     19:                        break;
                     20:                default:
                     21:                        if(!printable(c))
                     22:                                fprintf(yyout,"\\%-3o",c);
                     23:                        else 
                     24:                                putc(c,yyout);
                     25:                        break;
                     26:                }
                     27:        return;
                     28:        }
                     29: sprint(s)
                     30:   char *s; {
                     31:        while(*s)
                     32:                allprint(*s++);
                     33:        return;
                     34:        }
                     35: printable(c)
                     36:   int c;
                     37:        {
                     38:        return(040 < c && c < 0177);
                     39:        }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.