// File: namevalu.h // Author: Tyler Devore // Description: This file contains the class definition for NameValueList. // NameValueList is a linked list of name value pairs. #ifndef NAMEVALU_H #define NAMEVALU_H #define BUF 256 struct NameValueListeLem { char string[BUF]; // name of attribute char value[BUF]; // initial value of attribute string NameValueListeLem* next; }; // Class definition for NameValueList. class NameValueList { private: NameValueListeLem* h; // head of NameValueList public: NameValueList() { h=0; } // denotes an empty NameValueList ~NameValueList() { release(); } // returns memory to free store int read(char *filename); void add(char str[], char val[]); void del() { NameValueListeLem* temp = first(); h = h->next; delete temp; } NameValueListeLem* first() { return (h); } void print(); // display contents of NameValueList void release(); // return memory to free store }; #endif // NAMEVALU_H