User Tools

Site Tools


notes:data:fall2022:projects:dll2

BACKGROUND

SPECIFICATIONS

This week we are making some minor additions to the previous dll1 project.

First of all, a qty property has been added to the list struct (similar to sll3). This qty property keeps track of the number of nodes within a list. Adjust your functions to implement this new property.

  • qty: An 'unsigned long int,' that indicates the number of nodes contained within the 'list.'

Secondly, you will be redoing your display() function to include some new modes. The mode can be obtained from modding 16. Once you upgrade to dll2, your display function will be empty, but you may reuse your display code from dll1 and then add the new modes. Remember to change your invalid node handling first, otherwise you wont be able to accommodate for the new modes.

*Our task is to ask questions on Discord or in class and document our findings on this wiki page collaboratively, regarding the functionality of this project.

*For anybody interested in editing the wiki page, here is the dokuwiki user guide: https://www.dokuwiki.org/wiki:syntax#basic_text_formatting -Ash

If one is confused as to what modes correlate to what settings, this can be found in the data.h file inside the inc directory. Note that the new display maintains all the functions of the old display, so it is likely time-efficient to copy over your old display and edit it, rather than starting from scratch.

PROGRAM

Not too much to do besides display for this project. You are to add a qty similar to what we did in sll3 to all your functions that require it. Any functions that add a node, need to also increment the qty amount. While all the functions that remove a node, need to decrement the qty amount. The copy function now needs to copy the qty from the old list as well. Display will start from scratch with a fresh display.c file provided to you when you upgrade.

  • qty handling in [mklist], [append], [insert], [obtain]
  • new modes for [display]

OUTPUT SPECIFICATIONS

No new output from any function aside from display.

Display will have new modes of ASCII and Separators. The rest was previously available in your old display function.

UNIT TESTS

Unit tests this week are for the new qty values relating to your functions, and your new display function. Looking at the display unit tests is a good way to see what is the desired output for your display function and should be frequently referenced when building your display function. Unit tests are ran the same way this week as well, with make, and make check. Remember to run make clean before a new make to clean up old files. Also, you can make use of the make command -make use-test-reference. This uses a working implementation of object files from the previous dllX projects, and can very much help you if your previous projects did not pass all unit tests.

notes/data/fall2022/projects/dll2.txt · Last modified: 2022/11/11 01:23 by zswartwo