Precedente Successivo

I sorgenti: defs.h

Questo file non ha bisogno di particolari commenti. Si tratta semplicemente di tutte le definizioni comuni ad entrambi gli applicativi client e server. Si noti solamente la lunghezza costante di ogni messaggio.


#ifndef ES_DEFINE
#define ES_DEFINE

/*
 * Common definitions
 */

#define SERVER_PORT 5330
#define BUF_SIZE 1024
#define ANOTHER_DIR  "Another dir "	/* another dir in the client's list */
#define ANOTHER_FILE "Another file"	/* another file in the client's list */
#define NEW_DIR      "New dir     "	/* new dir on server side */
#define NEW_FILE     "New file    "	/* new file on server side */
#define DIR_REMOVED  "Dir removed "	/* server's dir was removed */
#define FILE_REMOVED "File removed"	/* server's file was removed */
#define ENTER_DIR    "Enter dir   "	/* recurse subdirectory */
#define FILE_UPDATED "File updated"	/* file needs to be updated */
#define NEWER_FILE   "Newer file  "	/* newer file on server side */
#define STAT         "Stat        "	/* stat data request */ 
#define END_LIST     "End of list "	/* no more file in the list */
#define LEN_MESGS sizeof(END_LIST)
#ifndef NAME_MAX
#define NAME_MAX 255
#endif
#define MSG_MAX NAME_MAX+1
#define FALSE 0
#define TRUE !FALSE

#endif

Precedente Successivo