#ifndef __common_h__ #define __common_h__ typedef enum { DATA, END, } mtype_t; typedef struct __msg_t { mtype_t type; int data; } msg_t; #define MAX_LINE (256) #define WHITESPACE " \t\n" // some useful routines int IsFifo(char *file) { struct stat sbuf; if (stat(file, &sbuf) < 0) return 1; return S_ISFIFO(sbuf.st_mode); } int IsRegular(char *file) { struct stat sbuf; if (stat(file, &sbuf) < 0) return 1; return S_ISREG(sbuf.st_mode); } #endif // __common_h__