Home | History | Annotate | Line # | Download | only in cpio
cpio_windows.h revision 1.1.1.1.30.1
      1           1.1     joerg /*-
      2           1.1     joerg  * Copyright (c) 2009 Michihiro NAKAJIMA
      3           1.1     joerg  * All rights reserved.
      4           1.1     joerg  *
      5           1.1     joerg  * Redistribution and use in source and binary forms, with or without
      6           1.1     joerg  * modification, are permitted provided that the following conditions
      7           1.1     joerg  * are met:
      8           1.1     joerg  * 1. Redistributions of source code must retain the above copyright
      9           1.1     joerg  *    notice, this list of conditions and the following disclaimer.
     10           1.1     joerg  * 2. Redistributions in binary form must reproduce the above copyright
     11           1.1     joerg  *    notice, this list of conditions and the following disclaimer in the
     12           1.1     joerg  *    documentation and/or other materials provided with the distribution.
     13           1.1     joerg  *
     14           1.1     joerg  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
     15           1.1     joerg  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     16           1.1     joerg  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     17           1.1     joerg  * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
     18           1.1     joerg  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     19           1.1     joerg  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     20           1.1     joerg  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     21           1.1     joerg  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     22           1.1     joerg  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     23           1.1     joerg  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     24           1.1     joerg  *
     25           1.1     joerg  * $FreeBSD$
     26           1.1     joerg  */
     27           1.1     joerg #ifndef CPIO_WINDOWS_H
     28           1.1     joerg #define CPIO_WINDOWS_H 1
     29  1.1.1.1.30.1  pgoyette #include <windows.h>
     30           1.1     joerg 
     31           1.1     joerg #include <io.h>
     32           1.1     joerg #include <string.h>
     33           1.1     joerg 
     34           1.1     joerg #define getgrgid(id)	NULL
     35           1.1     joerg #define getgrnam(name)	NULL
     36           1.1     joerg #define getpwnam(name)	NULL
     37           1.1     joerg #define getpwuid(id)	NULL
     38           1.1     joerg 
     39  1.1.1.1.30.1  pgoyette #if defined(_MSC_VER)
     40  1.1.1.1.30.1  pgoyette  #if _MSC_VER < 1900
     41  1.1.1.1.30.1  pgoyette  #define snprintf	sprintf_s
     42  1.1.1.1.30.1  pgoyette  #endif // _MSC_VER < 1900
     43           1.1     joerg #define strdup		_strdup
     44           1.1     joerg #define open	_open
     45           1.1     joerg #define read	_read
     46           1.1     joerg #define close	_close
     47           1.1     joerg #endif
     48           1.1     joerg 
     49           1.1     joerg struct passwd {
     50           1.1     joerg 	char	*pw_name;
     51           1.1     joerg 	uid_t	 pw_uid;
     52           1.1     joerg 	gid_t	 pw_gid;
     53           1.1     joerg };
     54           1.1     joerg 
     55           1.1     joerg struct group {
     56           1.1     joerg 	char	*gr_name;
     57           1.1     joerg 	gid_t	 gr_gid;
     58           1.1     joerg };
     59           1.1     joerg 
     60           1.1     joerg struct _timeval64i32 {
     61           1.1     joerg 	time_t		tv_sec;
     62           1.1     joerg 	long		tv_usec;
     63           1.1     joerg };
     64           1.1     joerg #define __timeval _timeval64i32
     65           1.1     joerg 
     66           1.1     joerg extern int futimes(int fd, const struct __timeval *times);
     67           1.1     joerg #ifndef HAVE_FUTIMES
     68           1.1     joerg #define HAVE_FUTIMES 1
     69           1.1     joerg #endif
     70           1.1     joerg extern int utimes(const char *name, const struct __timeval *times);
     71           1.1     joerg #ifndef HAVE_UTIMES
     72           1.1     joerg #define HAVE_UTIMES 1
     73           1.1     joerg #endif
     74           1.1     joerg 
     75           1.1     joerg #endif /* CPIO_WINDOWS_H */
     76