Added first functionality to client
This commit is contained in:
67
lib/api/api.c
Normal file
67
lib/api/api.c
Normal file
@ -0,0 +1,67 @@
|
||||
#include <api.h>
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
/* funzioni ausiliarie */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
int openConnection(const char* sockname, int msec, const struct timespec abstime){
|
||||
return 1;
|
||||
}
|
||||
|
||||
int closeConnection(const char* sockname){
|
||||
return 1;
|
||||
}
|
||||
|
||||
int openFile(const char* pathname, int flags){
|
||||
return 1;
|
||||
}
|
||||
|
||||
int readFile(const char* pathname, void** buf, size_t* size){
|
||||
return 1;
|
||||
}
|
||||
|
||||
int readNFiles(int N, const char* dirname){
|
||||
return 1;
|
||||
}
|
||||
|
||||
int writeFile(const char* pathname, const char* dirname){
|
||||
return 1;
|
||||
}
|
||||
|
||||
int appendToFile(const char* pathname, void* buf, size_t size, const char* dirname){
|
||||
return 1;
|
||||
}
|
||||
|
||||
int lockFile(const char* pathname){
|
||||
return 1;
|
||||
}
|
||||
|
||||
int unlockFile(const char* pathname){
|
||||
return 1;
|
||||
}
|
||||
|
||||
int closeFile(const char *pathname){
|
||||
return 1;
|
||||
}
|
||||
|
||||
int removeFile(const char* pathname){
|
||||
return 1;
|
||||
}
|
||||
|
||||
int setDirectory(char* Dir, int rw){
|
||||
return 1;
|
||||
}
|
||||
|
||||
void printInfo(int p){
|
||||
return;
|
||||
}
|
||||
40
lib/api/api.h
Normal file
40
lib/api/api.h
Normal file
@ -0,0 +1,40 @@
|
||||
#pragma once
|
||||
#ifndef _API_CLIENT
|
||||
#define _API_CLIENT
|
||||
|
||||
#include <time.h>
|
||||
|
||||
// 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);
|
||||
|
||||
#endif /* _API_CLIENT */
|
||||
Reference in New Issue
Block a user