Main Page Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members File Members Related Pages

# UnixFuncPrototypes.h

    00001 // This header file is meant to use the Visual C++ compiler
    00002 // to compile code for Unix. Thus, there are a number of
    00003 // functions and data types that need to be defined.
    00004
    00005 #ifndef __UNIX_FUNC_PROT__
    00006 #define __UNIX_FUNC_PROT__
    00007
    00008 #ifndef WIN32
    00009
    00010 #include <unistd.h>
    00011 #include <getopt.h>
    00012 #include <signal.h>
    00013 #include <sys/wait.h>
    00014 extern "C" {
    00015         #include <ppm.h>
    00016 }
    00017
    00018 #else
    00019
    00020 // CONSTANTS
    00021 #define SIGALRM 0
    00022 #define SIGKILL 0
    00023 #define WIFEXITED(A) 1
    00024
    00025 // DATA TYPES
    00026 typedef unsigned long pid_t;
    00027 typedef int pixel;
    00028 typedef int pixval;
    00029
    00030 struct option {
    00031         const char *name;
    00032         int has_arg;
    00033         int *flag;
    00034         int val;
    00035 };
    00036
    00037 char* optarg = NULL;
    00038 int optind = 0;
    00039
    00040 // FUNCTIONS
    00041 pid_t fork(void) { return 0; }
    00042 unsigned int alarm(unsigned int seconds)  { return 0; }
    00043 pid_t waitpid(pid_t pid, int *status, int options)  { return 0; }
    00044 void (*signal(int signum, void (*handler)(int)))(int) { return 0;}
    00045 int kill(pid_t pid, int sig)  { return 0; }
    00046
    00047 int getopt_long_only (int, char**, const char*, struct option*, int *);
    00048
    00049 // lib PPM functions
    00050 pixel** ppm_allocarray( int cols, int rows );
    00051 pixel* ppm_allocrow( int cols );
    00052 void ppm_freearray( pixel** pixels, int rows );
    00053 void pbm_freerow( pixel* pixelrow );
    00054 void ppm_readppminit( FILE* fp, int* colsP, int* rowsP, pixval* maxvalP, int* formatP );
    00055 void ppm_readppmrow( FILE* fp, pixel* pixelrow, int cols, pixval maxval, int format );
    00056 pixel** ppm_readppm( FILE* fp, int* colsP, int* rowsP, pixval* maxvalP );
    00057 void ppm_writeppminit( FILE* fp, int cols, int rows, pixval maxval, int forceplain );
    00058 void ppm_writeppmrow( FILE* fp, pixel* pixelrow, int cols, pixval maxval, int forceplain );
    00059 void ppm_writeppm( FILE* fp, pixel** pixels, int cols, int rows, pixval maxval, int forceplain );
    00060
    00061 #endif // no WIN32
    00062 #endif //__UNIX_FUNC_PROT__