printInfo
This commit is contained in:
@ -23,6 +23,8 @@ typedef struct openfiles_s {
|
||||
files_t *f;
|
||||
char *wDir; // for files sent from the server after openFile
|
||||
char *rDir; // for files read from the server
|
||||
int print; // whether to print
|
||||
FILE *out; // where to print
|
||||
} openfiles_t;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@ -62,6 +64,8 @@ int openConnection(const char* sockname, int msec, const struct timespec abstime
|
||||
openedFiles->numOfFiles = 0;
|
||||
openedFiles->rDir = NULL;
|
||||
openedFiles->wDir = NULL;
|
||||
openedFiles->print = 0;
|
||||
openedFiles->out = NULL;
|
||||
}
|
||||
|
||||
struct sockaddr_un sa;
|
||||
@ -178,7 +182,10 @@ int setDirectory(char* Dir, int rw) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
void printInfo(int p) {
|
||||
void printInfo(int p, FILE *stream) {
|
||||
// 1 prints, 0 does not print
|
||||
openedFiles->print = (p)? 1: 0;
|
||||
openedFiles->out = stream;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -38,6 +38,6 @@ int removeFile(const char* pathname);
|
||||
|
||||
int setDirectory(char* Dir, int rw);
|
||||
|
||||
void printInfo(int p);
|
||||
void printInfo(int p, FILE *stream);
|
||||
|
||||
#endif /* _API_CLIENT */
|
||||
|
||||
Reference in New Issue
Block a user