fish/fish_shell/fish_globbing.h

38 lines
1.3 KiB
C
Raw Normal View History

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*/
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*/
char* getFileName(char* string);
2017-06-19 13:06:37 +00:00
/*Given a string, return only the corresponding path, cutting the filename*/
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*/
char* concatWordListToWord(WordList* list, int firstElemIndex, int lastElemIndex);
2017-05-15 12:32:41 +00:00
#endif //FISH_FISH_GLOBBING_H