fileshare/include/main.h

38 lines
720 B
C

#ifndef MAIN_H
#define MAIN_H
#include <limits.h>
enum ResultCode {
RC_OK = 0, // No problem (so far)
RC_EXISTS = 1, // On upload, the file to be uploaded already existed
RC_OPEN_FAILED = 2, // On upload, opening the file for writing failed
RC_WRONG_TARGET = 3 // On upload, the given URL was not a directory
};
enum RequestType {
GET,
POST
};
struct ConnectionState {
char cleanedURL[PATH_MAX];
char localFileName[PATH_MAX];
struct stat targetStat;
FILE *upload_fd;
enum ResultCode result;
enum RequestType requestType;
struct MHD_PostProcessor *postProcessor;
};
struct RequestRange {
off_t start;
off_t length;
};
#endif // MAIN_H