Ext
 All Files Functions
utils.h
Go to the documentation of this file.
1 
7 #ifndef EXT_FILESYSTEM_UTILS_H_
8 #define EXT_FILESYSTEM_UTILS_H_
9 #include <stdlib.h>
10 #include <stdint.h>
11 #include <unistd.h>
12 #include <stdbool.h>
13 
14 #define buffer_length 1024
15 
23 int buffered_write(char** buffer, size_t* buffer_size, char* data, size_t size);
24 
32 int read_while(int fd, char* buffer, size_t to_read);
33 
41 int write_while(int fd, const char* buffer, size_t to_write);
42 
51 char* parse_path(const char* path, char* current_file_name);
52 
61 bool split_path(const char* path, char* parent_path, char* dirname);
62 
68 void read_command_from_stdin(char* command_buffer, size_t buffer_size);
69 
78 char* parse_command(char* command_buffer, char* command);
79 
85 ssize_t get_file_size(const char* path_to_file);
86 
87 #endif //EXT_FILESYSTEM_UTILS_H_
int read_while(int fd, char *buffer, size_t to_read)
Properly reading from memory.
Definition: utils.c:23
int write_while(int fd, const char *buffer, size_t to_write)
Properly writing to memory.
Definition: utils.c:38
char * parse_command(char *command_buffer, char *command)
Parse command Parse command to command and args. Put command to arg command and return position of fi...
Definition: utils.c:131
ssize_t get_file_size(const char *path_to_file)
Get size of file.
Definition: utils.c:145
void read_command_from_stdin(char *command_buffer, size_t buffer_size)
Read line from stdin.
Definition: utils.c:125
int buffered_write(char **buffer, size_t *buffer_size, char *data, size_t size)
Definition: utils.c:10