-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyFunctionalLib.h
executable file
·51 lines (37 loc) · 1.2 KB
/
myFunctionalLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef MYFUNCTIONALLIB_H
#define MYFUNCTIONALLIB_H
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <pwd.h>
//========== Structural Functions ==========
struct _MyFile{
char* myPrint;
char* myName;
char* myPath;
struct stat myStat;
int isItAFile;
char* myEPrint;
}; typedef struct _MyFile MyFile;
struct _myDirAndFileList{
MyFile* myFile;
struct _myDirAndFileList* next;
}; typedef struct _myDirAndFileList listOfFiles;
MyFile* create_File(char* name, char* path, int myIsItAFile);
listOfFiles* insertFile(MyFile* newFile, listOfFiles* list);
void printListOfFiles (listOfFiles* list);
void myListOfFilesPtrCpy(listOfFiles** dest, listOfFiles* ptrToCpy);
int nextFile(listOfFiles** list);
int supprNextFileOf(listOfFiles** list);
//========== Operational Functions ==========
char* completePathBuilder(listOfFiles* list);
void myStrPtrCpy(char** dest, char* ptrToCpy);
void myStrCat(char** dest, char* c);
void slashItCorrectly(char** str);
char* dateFormater(time_t st_mdate);
char* fonction_permission(struct stat s);
int countItems(char* myStr);
char** splitMyString (char* givenStr);
int changeMyBrackets(char** tabOfString, char* thePath);
#endif