Arrange H.E. (home edition)
by: burt rosenberg
at: university of miami
date: sep 2015

Helen Soros works the new pneumatic
tube system to take cash at
Marshall Fields store in Chicago,
November 26, 1947.
Goals
The goals of this project are:
- To exercise the tools of this course: subversion, C structs and Make.
- To understand the Testing directive of the course — to test to input-output
behavior, and to automate that test as much as possible.
- To exercise the use of options and arguments from the unix command line in a C program.
- To refresh knowledge of structs and malloc.
Man Page
NAME
arrange-h-e -- parse a command argument and store in a linked list
SYNOPSIS
arrange-h-e [-v] arg
DESCRIPION
Given an argument in the format
_name1_:_name2_:...:_nameN_
parse the _name?_ and place in a linked list, the output in reverse order as
_nameN_:...:_name2_:_name1_
Note that ":" literally the colon-character. Assume _name?_ are a sequence of letters
and possibly numbers, the period, or a hyphen.
The following options are available:
-v Verbose output
Note that an empty name on input should be discarded. For instance
:_name1_::_name2_ outputs _name2_:_name1_.
HISTORY
Introduced in csc424.162 based on a sub-task in the netbounce project.
BUGS
Specific steps
To get started:
- Setup ssh to a lab machine (connecting through lee).
- If MacOS, ssh is standard from the terminal, as the terminal is unix (FreeBSD).
- If Windows, setup cygwin.
- Check-out class/csc424.162 from svn.cs.miami.edu, as directed in your welcome email.
- Create directory proj1 just under your named directory and svn add proj1;
- Copy all of class/proj1 to [yourname]/proj1
- svn add these files files and commit with the message -m "initial commit".
- Modify arrange-h-e.c to solve the problem.
- Run the individual tests in the test target of the Makefile until arrange-h-e.c.
performs accordingly; double check that make test runs without differences.
- Commit for a grade by the due date.
Discussion
Use getopt to parse the command line. Parse the argument and use structs and malloc
to make a linked list of the parsed names in the command argument. Produce output
according to the correct syntax with the names in reverse order then in the command
argument.
If the output is verbose, -v option, the output can be your choice, and it is a helpful
option for your test and debugging. Without the -v option that output must be precisely
just the properly formated string. That way the automated tests can work.
The makefile provided gives certain required targets.
- make without target can either build
the binary or provide help what make targets I should use.
- make clean removes all build products.
- make test builds and does the basic test.
- make submit this is not the most important target, but targets associated
with subversion might be helpful to prevent lost time typing the repository and user name.
When submitting, Do Not Submit Build Products!. Your grade will be lowered.
In the repostory will be only source files. For the purposes of this course, binaries
in the repository a useless burden.