Changeset 4274


Ignore:
Timestamp:
Jan 15, 2010, 10:14:48 PM (7 years ago)
Author:
sam
Message:

Improve zzcat's manual page. Fixes #75.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/doc/zzcat.1.in

    r4255 r4274  
    11.TH zzcat 1 "2010-01-07" "zzcat @PACKAGE_VERSION@"
    22.SH NAME
    3 zzcat \- debugging tool for zzuf
     3zzcat \- concatenate files using different instruction sequences
    44.SH SYNOPSIS
    55\fBzzcat\fR [\fB\-AbeEntTv\fR] [\fB\-x\fR \fIsequence\fR] [\fIFILE\fR]...
     
    1616used to seek and read data.
    1717
    18 \fBzzcat\fR is primarily used as a debugging tool for \fBzzuf\fR.
    19 .SH USAGE
    20 .PP
    21 \fB    zzcat -x "fread(1,10000)" /dev/zero\fR
     18\fBzzcat\fR is primarily used as a debugging tool for \fBzzuf\fR, because
     19it can emulate different programs' ways to read files.
    2220.SH OPTIONS
    2321.TP
     
    5048\fIsequence\fR.
    5149
     50Instructions are executed sequentially until the end of the program.
     51End-of-file is not an exit condition, except where the \fBfeof\fR keyword is
     52used:
     53
     54\fB    fread(1,10); feof(1); fread(1,10)\fR
     55
     56Loops are permitted using the \fBrepeat\fR keyword. Again, \fBfeof\fR can be
     57used to prematurely break out of a loop:
     58
     59\fB    repeat(10000, fgetc() feof(1))\fR
     60
     61Instructions can be separated by spaces, commas or semicolons.
     62A list of all available instructions and control keywords can be obtained
     63using this command:
     64
     65\fB    zzcat \-l\fR
     66
    5267If no sequence is specified, the following default sequence is used:
    5368
    54 \fB    repeat(\-1, fread(1,32768), feof(1))
     69\fB    repeat(\-1, fread(1,32768), feof(1))\fR
     70
    5571.TP
    5672\fB\-l\fR, \fB\-\-list\fR
     
    6480.SH EXAMPLES
    6581.PP
    66 To do.
     82Read the first 1000 bytes of f, then exit:
     83.PP
     84\fB    zzcat \-x \(aqfread(1,1000)\(aq f\fR
     85.PP
     86Read the first four bytes of f, using four different instructions:
     87.PP
     88\fB    zzcat \-x \(aqgetc(),fgetc(),getc_unlocked(),_IO_getc()\(aq f\fR
     89.PP
     90Read f entirely, by calling \fBgetc()\fR repeatedly until end-of-file is
     91reached:
     92.PP
     93\fB    zzcat \-x \(aqrepeat(\-1, getc(), feof(1))\(aq \fRf
     94.PP
     95Read f entirely, in chunks of 32768 bytes until end-of-file is reached:
     96.PP
     97\fB    zzcat \-x \(aqrepeat(\-1, fread(1,32768), feof(1))\(aq \fRf
     98.\" .PP
     99.\" Read only odd bytes, rewind file, then read all even bytes:
     100.\" .PP
     101.\" \fB    zzcat \-x \(aqrepeat(\-1, getc(), feof(1), fseek(1,SEEK_CUR)),
     102.\" \fB              rewind(),
     103.\" \fB              repeat(\-1, fseek(1,SEEK_CUR), getc(), feof(1))\(aq
    67104.SH SEE ALSO
    68105.PP
Note: See TracChangeset for help on using the changeset viewer.