-
Notifications
You must be signed in to change notification settings - Fork 1
/
traversal.h
38 lines (26 loc) · 1.01 KB
/
traversal.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
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include "myStack.h"
#ifndef _TRAVERSAL
#define _TRAVERSAL
struct FileNode{
char* name;
int depth;
};
typedef struct FileNode FileNode;
FileNode* get_next_file(Stack* stack, int last_depth);
// Returns a file for thread to process.
bool is_directory(char *path);
// Returns True if pT is a directory.
bool is_file(char *path);
// Returns True if pT is a file
char** get_file_list(char* folder_name, int* file_count);
// Returns a list of file type children in pT if pT is a directory. Stores the number of files in num_files.
char** get_dir_list(char* folder_name, int* dir_count);
// Returns a list of directory type children in pT if pT is a directory. Stores the number of files in num_dirs.
Stack* push_multiple(Stack* stack, FileNode** data, int size);
// Adds Nodes with data Element to the front of the Stack.
char** add_file(char** arr, int* size, int* capacity, char* path);
char** listdir(const char *name, char** arr, int* size, int* capacity);
#endif