User Tools

Site Tools


haas:summer2015:data:projects:dll0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
haas:summer2015:data:projects:dll0 [2015/06/21 14:41] – [In inc/list.h] wedgehaas:summer2015:data:projects:dll0 [2015/06/27 20:30] (current) – [list library] wedge
Line 43: Line 43:
     Node              *last;               // pointer to end of list     Node              *last;               // pointer to end of list
 }; };
-typedef struct list    List;               // because we deserve nice things 
  
 code_t  mklist (List **);                  // create new list struct code_t  mklist (List **);                  // create new list struct
Line 79: Line 78:
 #define  DLL_DEFAULT_FAIL    0x0000000000002000 #define  DLL_DEFAULT_FAIL    0x0000000000002000
 #define  DLL_EMPTY           0x0000000000004000 #define  DLL_EMPTY           0x0000000000004000
-#define  DLL_RESERVED_CODE1  0x0000000000008000+#define  DLL_INVALID         0x0000000000008000
 </code> </code>
  
Line 94: Line 93:
   * **DLL_EMPTY** - result is an empty list (may or may not be in error)   * **DLL_EMPTY** - result is an empty list (may or may not be in error)
   * **DLL_DEFAULT_FAIL** - default state of unimplemented functions (default error)   * **DLL_DEFAULT_FAIL** - default state of unimplemented functions (default error)
-  * **DLL_FAIL** - some error occurred+  * **DLL_ERROR** - some error occurred 
 +  * **DLL_INVALID** - invalid use (passing a NULL pointer)
  
 For example, in the case of "DLL_MALLOC_FAIL", there are actually a total of three states raised: For example, in the case of "DLL_MALLOC_FAIL", there are actually a total of three states raised:
-  * DLL_FAIL (a problem has occurred)+  * DLL_ERROR (a problem has occurred)
   * DLL_MALLOC_FAIL (a problem has occurred when using malloc())   * DLL_MALLOC_FAIL (a problem has occurred when using malloc())
   * DLL_NULL (no memory allocated, so list cannot be anything but NULL)   * DLL_NULL (no memory allocated, so list cannot be anything but NULL)
Line 142: Line 142:
 To assist you in verifying a correct implementation, a fully working implementation of the node and list libraries should resemble the following (when running the respective verify script): To assist you in verifying a correct implementation, a fully working implementation of the node and list libraries should resemble the following (when running the respective verify script):
  
-====node library==== 
-Here is what you should get for node: 
- 
-<cli> 
-lab46:~/src/data/dll0$ bin/verify-node.sh  
-==================================================== 
-=    Verifying Doubly-Linked Node Functionality    = 
-==================================================== 
-  [mknode] Total:   5, Matches:   5, Mismatches:   0 
-  [cpnode] Total:   6, Matches:   6, Mismatches:   0 
-  [rmnode] Total:   2, Matches:   2, Mismatches:   0 
-==================================================== 
- [RESULTS] Total:  13, Matches:  13, Mismatches:   0 
-==================================================== 
-lab46:~/src/data/dll0$  
-</cli> 
  
 ====list library==== ====list library====
Line 167: Line 151:
 =    Verifying Doubly-Linked List Functionality    = =    Verifying Doubly-Linked List Functionality    =
 ==================================================== ====================================================
-  [mklist] Total:  11, Matches:  11, Mismatches:   0 +  [mklist] Total:  12, Matches:  12, Mismatches:   0 
-  [cplist] Total:  17, Matches:  17, Mismatches:   0 +  [cplist] Total:  18, Matches:  18, Mismatches:   0 
-  [append] Total:  22, Matches:  22, Mismatches:   0 +  [append] Total:  36, Matches:  36, Mismatches:   0 
-  [insert] Total:  22, Matches:  22, Mismatches:   0+  [insert] Total:  36, Matches:  36, Mismatches:   0
  [display] Total:  12, Matches:  12, Mismatches:   0  [display] Total:  12, Matches:  12, Mismatches:   0
     [find] Total:  28, Matches:  28, Mismatches:   0     [find] Total:  28, Matches:  28, Mismatches:   0
 ==================================================== ====================================================
- [RESULTS] Total: 112, Matches: 112, Mismatches:   0+ [RESULTS] Total: 142, Matches: 142, Mismatches:   0
 ==================================================== ====================================================
 lab46:~/src/data/dll0$  lab46:~/src/data/dll0$ 
haas/summer2015/data/projects/dll0.1434897703.txt.gz · Last modified: 2015/06/21 14:41 by wedge