Annotation of researchv10no/libpicfile/pic.601.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * Type-specific code for TYPE=ccir601
        !             3:  */
        !             4: #include <picfile.h>
        !             5: #include <libc.h>
        !             6: int PRD_601(f, buf)
        !             7: PICFILE *f;
        !             8: char *buf;
        !             9: {
        !            10:        if(f->line==0){
        !            11:                f->buf=malloc(f->width*2);
        !            12:                if(f->buf==0){
        !            13:                        PIC_error="Can't allocate buffer";
        !            14:                        return 0;
        !            15:                }
        !            16:        }
        !            17:        if(f->line==f->height){
        !            18:                PIC_error="Read past end of picture";
        !            19:                return 0;
        !            20:        }
        !            21:        /* read the file */
        !            22:        f->line++;
        !            23:        return 1;
        !            24: }
        !            25: int PWR_601(f, buf)
        !            26: PICFILE *f;
        !            27: char *buf;
        !            28: {
        !            29:        if(f->line==0){
        !            30:                f->buf=malloc(f->width*2);
        !            31:                if(f->buf==0){
        !            32:                        PIC_error="Can't allocate buffer";
        !            33:                        return 0;
        !            34:                }
        !            35:                PWR_header(f);
        !            36:        }
        !            37:        if(f->line>=f->height){
        !            38:                PIC_error="Write past end of picture";
        !            39:                return 0;
        !            40:        }
        !            41:        /* write the file */
        !            42:        f->line++;
        !            43:        return 1;
        !            44: }
        !            45: int PCL_601(f)
        !            46: PICFILE *f;
        !            47: {
        !            48:        free(f->buf);
        !            49: }

unix.superglobalmegacorp.com

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