Ext
 All Files Functions
Functions
handlers.h File Reference

Contains handlers for commands from server. More...

#include <stdbool.h>
#include <stdlib.h>

Go to the source code of this file.

Functions

bool receive_result (int sockd, int output_fd)
 
bool send_help_command (int sockd)
 
bool send_quit_command (int sockd)
 
bool send_init_command (int sockd)
 
bool send_read_fs_command (int sockd)
 
bool send_ls_command (int sockd, const char *path)
 
bool send_mkdir_command (int sockd, const char *path)
 
bool send_touch_command (int sockd, const char *path)
 
bool send_open_command (int sockd, const char *path)
 
bool send_close_command (int sockd, int fd)
 
bool send_lseek_command (int sockd, int fd, int size)
 
bool send_write_command (int sockd, int fd, char *data, size_t size)
 
bool send_read_command (int sockd, int fd, size_t size)
 
bool send_write_from_command (int sockd, int fd, const char *path)
 
bool send_read_to_command (int sockd, int fd, const char *path, size_t size)
 

Detailed Description

Contains handlers for commands from server.

Author
yaishenka
Date
25.04.2021

Definition in file handlers.h.

Function Documentation

bool receive_result ( int  sockd,
int  output_fd 
)

Read count of lines and lines from socket Prixnt result to stdout

Parameters
sockd
Author
yaishenka
Date
25.04.2021

Definition at line 12 of file handlers.c.

bool send_close_command ( int  sockd,
int  fd 
)

Send close command and wait for answer

Parameters
sockd
path
Returns

Definition at line 123 of file handlers.c.

bool send_help_command ( int  sockd)

Send help command and wait for answer

Parameters
sockd

Definition at line 58 of file handlers.c.

bool send_init_command ( int  sockd)

Send init command

Parameters
sockd

Definition at line 69 of file handlers.c.

bool send_ls_command ( int  sockd,
const char *  path 
)

Send ls command and wait for answer

Parameters
sockd

Definition at line 77 of file handlers.c.

bool send_lseek_command ( int  sockd,
int  fd,
int  size 
)

Send lseek command and wait for answer

Parameters
sockd
size
Returns

Definition at line 138 of file handlers.c.

bool send_mkdir_command ( int  sockd,
const char *  path 
)

Send mkdir command and wait for answer

Parameters
sockd
path
Returns

Definition at line 87 of file handlers.c.

bool send_open_command ( int  sockd,
const char *  path 
)

Send open command and wait for answer

Parameters
sockd
path
Returns

Definition at line 111 of file handlers.c.

bool send_quit_command ( int  sockd)

Send quit command

Parameters
sockd

Definition at line 65 of file handlers.c.

bool send_read_command ( int  sockd,
int  fd,
size_t  size 
)

Send read command and wait for answer

Parameters
sockd
fd
size
Returns

Definition at line 167 of file handlers.c.

bool send_read_fs_command ( int  sockd)

Send read fs command

Parameters
sockd
Returns

Definition at line 73 of file handlers.c.

bool send_read_to_command ( int  sockd,
int  fd,
const char *  path,
size_t  size 
)

Send read to command and wait for answer

Parameters
sockd
fd
path
size
Returns

Definition at line 219 of file handlers.c.

bool send_touch_command ( int  sockd,
const char *  path 
)

Send touch command and wait for answer

Parameters
sockd
path
Returns

Definition at line 99 of file handlers.c.

bool send_write_command ( int  sockd,
int  fd,
char *  data,
size_t  size 
)

Send write command and wait for answer

Parameters
sockd
fd
data
size
Returns

Definition at line 153 of file handlers.c.

bool send_write_from_command ( int  sockd,
int  fd,
const char *  path 
)

Send write from command and wait for answer

Parameters
sockd
fd
path
Returns

Definition at line 194 of file handlers.c.