#pragma once #ifndef _API_CLIENT #define _API_CLIENT #include struct timespec; #define O_CREATE 1 #define O_LOCK 2 // struttura dati per la lista dei file aperti typedef struct openFile_s { char *filename; // nome del file struct openFile_s *next; // puntatore al prossimo elemento nella lista } openFile_t; int openConnection(const char* sockname, int msec, const struct timespec abstime); int closeConnection(const char* sockname); int openFile(const char* pathname, int flags); int readFile(const char* pathname, void** buf, size_t* size); int readNFiles(int N, const char* dirname); int writeFile(const char* pathname, const char* dirname); int appendToFile(const char* pathname, void* buf, size_t size, const char* dirname); int lockFile(const char* pathname); int unlockFile(const char* pathname); int closeFile(const char *pathname); int removeFile(const char* pathname); int setDirectory(char* Dir, int rw); void printInfo(int p, FILE *stream); #endif /* _API_CLIENT */