Changeset 53 for trunk/src/helpers/linklist.c
- Timestamp:
- Apr 2, 2001, 12:38:55 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/linklist.c
r47 r53 1071 1071 * a pseudo-stack LIFO LINKLIST using lstPush. 1072 1072 * 1073 * Note that to really "pop" the item, i.e. remove 1074 * it from the list, you MUST call lstRemoveNode 1075 * with the list node returned from this function, 1076 * or otherwise you keep getting the same last item 1077 * on subsequent calls. 1073 * If (fRemove == TRUE), the item is also removed 1074 * from the stack. Otherwise it remains there so the 1075 * next lstPop would return the next item. 1078 1076 * 1079 1077 * Example: … … 1081 1079 + LINKLIST ll; 1082 1080 + PLISTNODE pNode; 1083 + lstInit(&ll, FALSE ;1081 + lstInit(&ll, FALSE); 1084 1082 + 1085 1083 + lstPush(&ll, (PVOID)1); 1086 1084 + lstPush(&ll, (PVOID)2); 1087 1085 + 1088 + pNode = lstPop(&ll); 1086 + pNode = lstPop(&ll); // returns the node containing "2" 1089 1087 + lstRemoveNode(pNode); 1090 + pNode = lstPop(&ll); // returns the node containing "1" 1091 + lstRemoveNode(pNode); 1088 + pNode = lstPop(&ll); // returns the node containing "1" 1092 1089 * 1093 1090 *@@added V0.9.3 (2000-05-18) [umoeller] … … 1097 1094 { 1098 1095 return (pList->pLast); 1099 /* unsigned long cItems = lstCountItems(pList); 1100 if (cItems) 1101 { 1102 // list not empty: 1103 // get last item on the list 1104 pNodeReturn = lstNodeFromIndex(pList, 1105 cItems - 1); 1106 } 1107 return (pNodeReturn); */ 1108 } 1109 1096 } 1097 1098
Note:
See TracChangeset
for help on using the changeset viewer.