CSE 271: Programming Assignment 4

Assigned: 8 February
Due: 13 February

Abstract

Extend the simple character compression filter of p3 to
  1. process command line arguments
  2. handle command line options
  3. provide decompression capabilities

Details

Take the compression program written for p3, and: In addition, use the getopt(3c) function to add the following options to your simple compressor: Generate a specific error message followed by a usage message to stderr if the command line arguments are incorrect.

In general, the program should have all the default features and functionality of the previous version. Note that since this version also decompresses, you can now use this program to test itself.

Note that this program must be able to compress newlines as well as anything else. Take a look at the sample solution for p3 to see a version that does compress newlines if you are uncertain that your p3 submission is correct. (Note that the sample solution will only be available starting a few days after p3 is due.)

Submission Requirements

  1. As usual, the program must be named p4.c and must reside in the cse271.131/p4 subdirectory.
  2. Divide the source code into two or more .c and .h files.
  3. Create and use an appropriate Makefile that will compile your program using make into an executable named p4, and will clean the directory with make clean.
  4. Your name must be in the comment section (along with appropriate description, etc.).
  5. Do a touch DONE when the program is ready to be collected.

Last revised: 2 February 2013.