ADMB Documentation  11.1.1631
 All Classes Files Functions Variables Typedefs Friends Defines
pvmwin.h
Go to the documentation of this file.
00001 /*
00002  * $Id: pvmwin.h 1112 2013-07-12 21:41:41Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  *
00007  * ADModelbuilder and associated libraries and documentations are
00008  * provided under the general terms of the "BSD" license.
00009  *
00010  * License:
00011  *
00012  * Redistribution and use in source and binary forms, with or without
00013  * modification, are permitted provided that the following conditions are
00014  * met:
00015  *
00016  * 1. Redistributions of source code must retain the above copyright
00017  * notice, this list of conditions and the following disclaimer.
00018  *
00019  * 2.  Redistributions in binary form must reproduce the above copyright
00020  * notice, this list of conditions and the following disclaimer in the
00021  * documentation and/or other materials provided with the distribution.
00022  *
00023  * 3.  Neither the name of the  University of California, Otter Research,
00024  * nor the ADMB Foundation nor the names of its contributors may be used
00025  * to endorse or promote products derived from this software without
00026  * specific prior written permission.
00027  *
00028  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00029  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00030  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00031  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00032  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00033  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00034  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00035  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00036  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00037  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00038  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00039  *
00040  */
00045 /*
00046  *         PVM version 3.4:  Parallel Virtual Machine System
00047  *               University of Tennessee, Knoxville TN.
00048  *           Oak Ridge National Laboratory, Oak Ridge TN.
00049  *                   Emory University, Atlanta GA.
00050  *      Authors:  J. J. Dongarra, G. E. Fagg, M. Fischer,
00051  *          G. A. Geist, J. A. Kohl, R. J. Manchek, P. Mucci,
00052  *         P. M. Papadopoulos, S. L. Scott, and V. S. Sunderam
00053  *                   (C) 1997 All Rights Reserved
00054  *
00055  *                              NOTICE
00056  *
00057  * Permission to use, copy, modify, and distribute this software and
00058  * its documentation for any purpose and without fee is hereby granted
00059  * provided that the above copyright notice appear in all copies and
00060  * that both the copyright notice and this permission notice appear in
00061  * supporting documentation.
00062  *
00063  * Neither the Institutions (Emory University, Oak Ridge National
00064  * Laboratory, and University of Tennessee) nor the Authors make any
00065  * representations about the suitability of this software for any
00066  * purpose.  This software is provided ``as is'' without express or
00067  * implied warranty.
00068  *
00069  * PVM version 3 was funded in part by the U.S. Department of Energy,
00070  * the National Science Foundation and the State of Tennessee.
00071  */
00072 
00073 /* cruft file for different compiler specifications
00074 *  like Watcom, Visual, Borland ...
00075 *
00076 *  added __fortran stub    06/21/1997   Fischer
00077 */
00078 
00079 
00080 #ifdef WIN32
00081 #define __fortran __stdcall
00082 #endif
00083 
00084 #define STRICT
00085 
00086 #include <sys/timeb.h>
00087 #include <time.h>
00088 #include <process.h>
00089 #include <winsock.h>
00090 
00091 #include <windows.h>
00092 
00093 /*  WIN32 gets stdarg.h via pvm3.h -> pvmwin.h -> windows.h
00094   nice coding trail - NOT...
00095   since WIN32 is not a __STDC__ environment - it needs varargs.h
00096   so, this will cleanup the incorrect include order for var args
00097   from windows.h first must remove va_start va_end to avoid compiler
00098   warnings...  Someone else must then include the varargs.h file
00099   or that will then cause error.
00100   uggghhhhh... this is ugly coding at its best
00101 */
00102 
00103 #ifdef WIN32
00104 #undef va_start
00105 #undef va_end
00106 #endif
00107 
00108 #include <stdio.h>
00109 #include <io.h>
00110 
00111 #ifndef HASSTDLIB
00112 #define HASSTDLIB
00113 #endif
00114 
00115 #ifndef SYSVBFUNC
00116 #define SYSVBFUNC
00117 #endif
00118 
00119 #ifndef SYSVSTR
00120 #define SYSVSTR
00121 #endif
00122 
00123 #ifndef HASERRORVARS
00124 #define HASERRORVARS
00125 #endif
00126 
00127 #ifndef NOWAIT3
00128 #define NOWAIT3
00129 #endif
00130 
00131 #ifndef NOGETDTBLSIZ
00132 #define NOGETDTBLSIZ
00133 #endif
00134 
00135 #ifndef ARCHCLASS
00136 #define ARCHCLASS "WIN32"
00137 #endif
00138 
00139 #ifndef NOUNIXDOM
00140 #define NOUNIXDOM
00141 #endif
00142 
00143 #ifndef NOTMPNAM
00144 #define NOTMPNAM
00145 #endif
00146 
00147 #ifndef HASERRORVARS
00148 #define HASERRORVARS
00149 #endif
00150 /* sys/param.h doesn't exist: */
00151 #define MAXHOSTNAMELEN 64
00152 #define MAXPATHLEN 64
00153 
00154 #ifndef TIME
00155 #define TIME
00156 struct timezone {
00157   int tz_minuteswest;
00158   int tz_dsttime;
00159 };
00160 #endif
00161 
00162 
00163 /* to keep the compiler satisfied */
00164 extern int gettimeofday(struct timeval *, struct timezone *);
00165 extern char *MyGetUserName();
00166 extern int kill(int,int, int);
00167 
00168 extern HANDLE win32_open_file( char *);
00169 extern HANDLE win32_create_file(char *s, int );
00170 extern int win32_close_file(HANDLE);
00171 extern int win32_write_file(HANDLE,char *,int);
00172 extern int win32_read_file(HANDLE,char *, int);
00173 extern int win32_write_socket (SOCKET, const char FAR *, int);
00174 extern int win32_read_socket (SOCKET, char FAR *, int);
00175 
00176 extern void Wait(HANDLE id, DWORD *prv);
00177