This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:fall2015:data:projects:dln0 [2015/10/25 22:02] – [In inc/node.h] wedge | haas:fall2015:data:projects:dln0 [2015/10/25 22:06] (current) – [node library] wedge | ||
---|---|---|---|
Line 75: | Line 75: | ||
#define _DATA_H | #define _DATA_H | ||
+ | ////////////////////////////////////////////////////////////////////// | ||
+ | // | ||
+ | // We make use of NULL, so we need stdlib | ||
+ | // | ||
#include < | #include < | ||
+ | ////////////////////////////////////////////////////////////////////// | ||
+ | // | ||
+ | // Set up union for node payload (multipurpose use) | ||
+ | // | ||
+ | union info { | ||
+ | char | ||
+ | struct node *data; | ||
+ | void *other; | ||
+ | }; | ||
+ | |||
+ | ////////////////////////////////////////////////////////////////////// | ||
+ | // | ||
+ | // node struct helper defines | ||
+ | // | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | ////////////////////////////////////////////////////////////////////// | ||
+ | // | ||
+ | // create some peers to NULL for our endeavors: UNDEFINED | ||
+ | // | ||
+ | #if !defined(UNDEFINED) | ||
+ | #define UNDEFINED ((void*)1) | ||
+ | #endif | ||
+ | |||
+ | ////////////////////////////////////////////////////////////////////// | ||
+ | // | ||
// custom types (mostly for shortening typing) | // custom types (mostly for shortening typing) | ||
// | // | ||
Line 84: | Line 116: | ||
typedef | typedef | ||
+ | ////////////////////////////////////////////////////////////////////// | ||
+ | // | ||
// Status codes for the doubly linked node implementation | // Status codes for the doubly linked node implementation | ||
// | // | ||
- | # | + | # |
- | # | + | # |
- | # | + | # |
- | # | + | # |
- | # | + | # |
- | # | + | # |
- | # | + | # |
- | # | + | # |
- | + | ||
- | // Function prototypes | + | |
- | // | + | |
- | void lscodes(code_t); | + | |
#endif | #endif | ||
Line 123: | Line 153: | ||
You'll notice these #defines map to numeric values, and particular ones at that. This is to our supreme advantage: if you understand how numbers work, you should have an easy time of working with these status codes. | You'll notice these #defines map to numeric values, and particular ones at that. This is to our supreme advantage: if you understand how numbers work, you should have an easy time of working with these status codes. | ||
+ | |||
+ | ====In inc/ | ||
+ | Finally we have support.h... this header will contain some information on helper functions utilized in the various unit tests. You really don't need to bother with this... in fact, do not use any of these functions in your implementation. | ||
====node library==== | ====node library==== | ||
In **src/ | In **src/ | ||
Line 143: | Line 176: | ||
====================================================== | ====================================================== | ||
[mknode] Total: | [mknode] Total: | ||
- | [cpnode] Total: | + | [cpnode] Total: |
[rmnode] Total: | [rmnode] Total: | ||
====================================================== | ====================================================== | ||
- | | + | |
====================================================== | ====================================================== | ||
lab46: | lab46: | ||
</ | </ | ||
- | |||
=====Submission===== | =====Submission===== | ||
{{page> | {{page> | ||