-
Notifications
You must be signed in to change notification settings - Fork 0
/
format.h
104 lines (88 loc) · 2.58 KB
/
format.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/**
* @file client_server_program.h
* @brief Header file for client-server communication program.
*
* This file contains the declarations for functions used in the client-server
* communication program. It provides utility functions for printing various
* messages related to the client's usage, error handling, and server communication.
*/
#pragma once
#include <stdio.h>
#include <stdlib.h>
/**
* @brief Error message for bad request.
*/
extern const char *err_bad_request;
/**
* @brief Error message for bad file size.
*/
extern const char *err_bad_file_size;
/**
* @brief Error message for no such file.
*/
extern const char *err_no_such_file;
/**
* @brief Prints usage information for the client.
*
* This function displays the correct way to use the client program.
*/
void print_client_usage(void);
/**
* @brief Prints help information for the client.
*
* This function displays detailed help information about the client's options and usage.
*/
void print_client_help(void);
/**
* @brief Prints a message indicating that the connection has been closed.
*
* This function notifies the user that the connection to the server has been closed.
*/
void print_connection_closed(void);
/**
* @brief Prints a specified error message.
*
* @param err The error message to print.
*
* This function displays the provided error message to the user.
*/
void print_error_message(char *err);
/**
* @brief Prints a message indicating an invalid response from the server.
*
* This function notifies the user that the response received from the server was invalid.
*/
void print_invalid_response(void);
/**
* @brief Prints a message indicating that too little data was received.
*
* This function notifies the user that the amount of data received was insufficient.
*/
void print_too_little_data(void);
/**
* @brief Prints a message indicating that too much data was received.
*
* This function notifies the user that more data than expected was received.
*/
void print_received_too_much_data(void);
/**
* @brief Prints a success message.
*
* This function informs the user that the operation was successful.
*/
void print_success(void);
/**
* @brief Prints the temporary directory path.
*
* @param temp_directory The path to the temporary directory.
*
* This function displays the path to the temporary directory used by the program.
*/
void print_temp_directory(char *temp_directory);
/**
* @brief Prints usage information for the server.
*
* This function displays the correct way to use the server program.
*/
void print_server_usage(void);
#endif // CLIENT_SERVER_PROGRAM_H