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.
Search.h File Reference

Header file that contains the definitions of our Search (crawler) More...

#include <sys/stat.h>
#include <dirent.h>
#include <stdlib.h>
#include <string.h>
#include "Syscall.h"
#include "Logger.h"
#include "List.h"
Include dependency graph for Search.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SECONDS_IN_DAY   86400
 

Enumerations

enum  searchType {
  NONE, NAME, SIZE_SMALLER, SIZE_EQUAL,
  SIZE_BIGGER, STATUS_DATE_B, STATUS_DATE_E, STATUS_DATE_A,
  MODIF_DATE_B, MODIF_DATE_E, MODIF_DATE_A, USAGE_DATE_B,
  USAGE_DATE_E, USAGE_DATE_A, OWNER, GROUP,
  MODE
}
 

Functions

ListsearchDirectory (const char *rootDir, searchType type, const void *searchArg)
 
int timeCompare (struct timespec *candidate, struct timespec *searchTime)
 

Detailed Description

Header file that contains the definitions of our Search (crawler)

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

Function Documentation

List* searchDirectory ( const char *  rootDir,
searchType  type,
const void *  searchArg 
)

Searches recursively through directories beneath a certain directory

Parameters
rootDirThe directory to start from
typeThe type of search to perform
searchArgThe argument for the search
Returns
A list of matching files
int timeCompare ( struct timespec *  candidate,
struct timespec *  searchTime 
)

Function to compare 2 timespecs

Parameters
candidateThe candidate timespec
searchTimeThe one we're comparing it to
Returns
0 if the date is the same, -1 if the date of the candidate is earlier than the search, 1 otherwise