SmartFolder  1.0
SmartFolder is a way to search files on your system and group the results. The program will interpret search queries and create a folder with symbolic links to all the found matches.
HashSet.c File Reference

Source file that contains the implementation for a HashSet data structure containing Strings. More...

#include "HashSet.h"
Include dependency graph for HashSet.c:

Functions

HashSetinitSet (int size)
 
void expand (HashSet *table)
 
void putAll (HashSet *table, List *list)
 
void put (HashSet *table, char *filePath)
 
void removeFromSet (HashSet *table, char *filePath)
 
int contains (HashSet *table, char *filePath)
 
int searchInSet (HashSet *table, char *filePath)
 
int hash (char *text)
 
void deleteSet (HashSet **table)
 
void dumpSet (HashSet *table)
 

Detailed Description

Source file that contains the implementation for a HashSet data structure containing Strings.

Authors
Maxime Lovino, Thomas Ibanez
Date
January 25, 2017
Version
1.0

Function Documentation

int contains ( HashSet table,
char *  filePath 
)

Function to check if a String is contained in the HashSet

Parameters
tableA pointer to the HashSet we want to check in
filePathThe String we want to check
Returns
1 if the String is in the HashSet, 0 otherwise
void deleteSet ( HashSet **  table)

Function to delete a HashSet and free the memory

Parameters
tableA double pointer to the HashSet we want to delete
void dumpSet ( HashSet table)

Function to log all of the HashSet content

Parameters
tableA pointer to the HashSet we want to log
void expand ( HashSet table)

Function that expands the size of an HashSet

Parameters
tableA pointer to the HashSet we want to expand
int hash ( char *  text)

Hashing function for a String

Parameters
textThe String we want to hash
Returns
The hash of the String
HashSet* initSet ( int  size)

Initialisation function for a HashSet

Parameters
sizeThe initial size of the set
Returns
A pointer to a HashSet of the correct size
void put ( HashSet table,
char *  filePath 
)

Function to insert a String in the HashSet

Parameters
tableA pointer to the HashSet we want to insert in
filePathThe String we want to insert
void putAll ( HashSet table,
List list 
)

Function to insert all elements of a list in a HashSet

Parameters
tableA pointer to the HashSet where we want to insert
listThe list that we want to insert
void removeFromSet ( HashSet table,
char *  filePath 
)

Function to remove a String from the HashSet

Parameters
tableA pointer to the HashSet we want to remove from
filePathThe String we want to remove
int searchInSet ( HashSet table,
char *  filePath 
)

Function to get the value of the index in the HashSet of a String

Parameters
tableA pointer to the HashSet we want to find in
filePathThe String we want to find
Returns
The index of the String in the HashSet