#ifndef FILELIST_C_ #define FILELIST_C_ #include #include #include #include "invertedIndex.h" // Forward declaration for strdup in char *strdup(const char *); /* * File list node is unfortuntely defined in "invertedIndex.h": struct FileListNode { char *filename; double tf; // relative tf struct FileListNode *next; }; */ // Returns a newly malloc'ed file list node, with fields initialised to zero. struct FileListNode *createFileListNode(); // Appends a FileListNode to the end of a FileListNode linked list. struct FileListNode *insertFileList(struct InvertedIndexNode *head, char *const word); // Inserts a fileListNode into a list via ordering of tf values. If the tf // values are equal, inserts based off the filename in ascending order. // Returns the new head of the list. struct FileListNode *insertFileOrderedList(struct FileListNode *head, struct FileListNode *insert, double mult); #endif