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