Home | History | Annotate | Line # | Download | only in cpio
cpio_windows.h revision 1.1.1.3
      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 #ifndef CPIO_WINDOWS_H
     26      1.1  joerg #define CPIO_WINDOWS_H 1
     27  1.1.1.2  joerg #include <windows.h>
     28      1.1  joerg 
     29      1.1  joerg #include <io.h>
     30      1.1  joerg #include <string.h>
     31      1.1  joerg 
     32      1.1  joerg #define getgrgid(id)	NULL
     33      1.1  joerg #define getgrnam(name)	NULL
     34      1.1  joerg #define getpwnam(name)	NULL
     35      1.1  joerg #define getpwuid(id)	NULL
     36      1.1  joerg 
     37  1.1.1.2  joerg #if defined(_MSC_VER)
     38  1.1.1.2  joerg  #if _MSC_VER < 1900
     39  1.1.1.2  joerg  #define snprintf	sprintf_s
     40  1.1.1.2  joerg  #endif // _MSC_VER < 1900
     41      1.1  joerg #define strdup		_strdup
     42      1.1  joerg #define open	_open
     43      1.1  joerg #define read	_read
     44      1.1  joerg #define close	_close
     45      1.1  joerg #endif
     46      1.1  joerg 
     47      1.1  joerg struct passwd {
     48      1.1  joerg 	char	*pw_name;
     49      1.1  joerg 	uid_t	 pw_uid;
     50      1.1  joerg 	gid_t	 pw_gid;
     51      1.1  joerg };
     52      1.1  joerg 
     53      1.1  joerg struct group {
     54      1.1  joerg 	char	*gr_name;
     55      1.1  joerg 	gid_t	 gr_gid;
     56      1.1  joerg };
     57      1.1  joerg 
     58      1.1  joerg struct _timeval64i32 {
     59      1.1  joerg 	time_t		tv_sec;
     60      1.1  joerg 	long		tv_usec;
     61      1.1  joerg };
     62      1.1  joerg #define __timeval _timeval64i32
     63      1.1  joerg 
     64      1.1  joerg extern int futimes(int fd, const struct __timeval *times);
     65      1.1  joerg #ifndef HAVE_FUTIMES
     66      1.1  joerg #define HAVE_FUTIMES 1
     67      1.1  joerg #endif
     68      1.1  joerg extern int utimes(const char *name, const struct __timeval *times);
     69      1.1  joerg #ifndef HAVE_UTIMES
     70      1.1  joerg #define HAVE_UTIMES 1
     71      1.1  joerg #endif
     72      1.1  joerg 
     73      1.1  joerg #endif /* CPIO_WINDOWS_H */
     74