2017-05-15 12:32:41 +00:00
|
|
|
#ifndef FISH_FISH_GLOBBING_H
|
|
|
|
#define FISH_FISH_GLOBBING_H
|
|
|
|
|
|
|
|
typedef struct dirent dirent;
|
|
|
|
|
|
|
|
|
2017-06-19 13:06:37 +00:00
|
|
|
/*send back a WordList containing every path correspnding to the different expand*/
|
2017-05-28 20:02:05 +00:00
|
|
|
WordList* fishExpand(WordList* wordArray);
|
2017-05-15 12:32:41 +00:00
|
|
|
|
2017-06-19 13:06:37 +00:00
|
|
|
/*return a WordList containing every file in a path corresponding to a bash-like regex*/
|
2017-05-28 20:02:05 +00:00
|
|
|
WordList* getFiles(char* path, char* wildcardedString);
|
2017-05-15 12:32:41 +00:00
|
|
|
|
2017-06-19 13:06:37 +00:00
|
|
|
|
|
|
|
/*return a WordList containing every path corresponding to the expand of a word ( in shell meaning )*/
|
2017-05-27 15:36:55 +00:00
|
|
|
WordList* expandWord(char* word);
|
2017-05-16 05:32:19 +00:00
|
|
|
|
2017-06-19 13:06:37 +00:00
|
|
|
/*Launch recursively the expand for every directory, and add each found path in listToExpand*/
|
2017-05-30 09:31:00 +00:00
|
|
|
void recursiveExpandWord(char* path, WordList* listToExpand);
|
|
|
|
|
2017-06-19 13:06:37 +00:00
|
|
|
/*function returning true or false, depending on the regex matching of string2 with string1*/
|
2017-05-28 20:02:05 +00:00
|
|
|
int wildcardedStringMatches(char* string1, char* string2);
|
|
|
|
|
2017-06-19 13:06:37 +00:00
|
|
|
|
|
|
|
/*transform a string in a word list by splitting on splitchar*/
|
2017-05-29 13:19:52 +00:00
|
|
|
WordList* splitWordIntoList(char* string, char splitchar);
|
|
|
|
|
2017-06-19 13:06:37 +00:00
|
|
|
|
|
|
|
/*Given a string, return only the corresponding filename, deleting the path*/
|
2017-05-29 15:25:31 +00:00
|
|
|
char* getFileName(char* string);
|
|
|
|
|
2017-06-19 13:06:37 +00:00
|
|
|
/*Given a string, return only the corresponding path, cutting the filename*/
|
2017-05-29 15:25:31 +00:00
|
|
|
char* getPath(char* string);
|
|
|
|
|
2017-06-19 13:06:37 +00:00
|
|
|
/*Transform a word list into a string by concatenating every element of the list*/
|
2017-05-30 09:31:00 +00:00
|
|
|
char* concatWordListToWord(WordList* list, int firstElemIndex, int lastElemIndex);
|
|
|
|
|
2017-05-15 12:32:41 +00:00
|
|
|
#endif //FISH_FISH_GLOBBING_H
|