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.
List.c File Reference

Source file that contains the implementation for a simple linked List data structure containing Strings. More...

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

Functions

ListinitList ()
 
void insert (List *l, char *element)
 
void removeIndex (List *l, int idx)
 
void removeObject (List *l, char *element)
 
int searchInList (List *l, char *element)
 
char * get (List *l, int idx)
 
ListlistUnion (List *l1, List *l2)
 
ListlistIntersect (List *l1, List *l2)
 
ListlistXOR (List *l1, List *l2)
 
ListlistComplement (List *l1, List *l2)
 
void deleteList (List *l)
 
void dumpList (List *l)
 

Detailed Description

Source file that contains the implementation for a simple linked List data structure containing Strings.

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

Function Documentation

void deleteList ( List l)

Function that deletes a List and frees the memory

Parameters
lA pointer to the List
void dumpList ( List l)

Function that all the elements of a List

Parameters
lA pointer to the List
char* get ( List l,
int  idx 
)

Function to get the value of an element at a specific index

Parameters
lA pointer to the List
idxThe index of the element we want
Returns
The value of the element
List* initList ( )

Function to initialize an empty List

Returns
A pointer to an empty List
void insert ( List l,
char *  element 
)

Function to insert a String into the List, we insert at the beginning

Parameters
lA pointer to the List we want to insert
elementThe String we want to insert
List* listComplement ( List l1,
List l2 
)

Function that computes the complement between the first List and the second (l1 - l2) This means the elements contained in the first List that are NOT in the second one

Parameters
l1A pointer to the first List
l2A pointer to the second List
Returns
A new List that is the complement of the two lists
List* listIntersect ( List l1,
List l2 
)

Function that computes the intersection between two Lists (logical AND)

Parameters
l1A pointer to the first List
l2A pointer to the second List
Returns
A new List that is the intersection of the two Lists
List* listUnion ( List l1,
List l2 
)

Function that computes the union between two Lists (logical OR)

Parameters
l1A pointer to the first List
l2A pointer to the second List
Returns
A new List that is the union of the two lists
List* listXOR ( List l1,
List l2 
)

Function that computes the XOR between two Lists (logical XOR) This means the elements contained in only one of the two Lists, but not both

Parameters
l1A pointer to the first List
l2A pointer to the second List
Returns
A new List that is the XOR of the two lists
void removeIndex ( List l,
int  idx 
)

Function to remove the element at an index from the List

Parameters
lA pointer to the List we want to remove from
idxThe index at which we want to remove
void removeObject ( List l,
char *  element 
)

Function to remove a String from the List

Parameters
lA pointer to the List we want to remove from
elementThe String we want to remove
int searchInList ( List l,
char *  element 
)

Function to retrieve the index of an element from the List

Parameters
lA pointer to the List we want to search in
elementThe element we're looking for
Returns
The index of that element in the List, or -1 if it isn't in the List