2 Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
38 #ifndef _CLASSPATH_IO_H_INCLUDED
39 #define _CLASSPATH_IO_H_INCLUDED
43 #define CPFILE_FLAG_CREATE 0x0001
44 #define CPFILE_FLAG_APPEND 0x0002
45 #define CPFILE_FLAG_TRUNCATE 0x0004
46 #define CPFILE_FLAG_SYNC 0x0008
47 #define CPFILE_FLAG_DSYNC 0x0010
48 #define CPFILE_FLAG_BINARY 0x0020
49 #define CPFILE_FLAG_READ 0x0040
50 #define CPFILE_FLAG_WRITE 0x0080
52 #define CPFILE_PERMISSION_NORMAL 1
54 #define CPFILE_FLAG_READWRITE (CPFILE_FLAG_READ|CPFILE_FLAG_WRITE)
56 JNIEXPORT
int cpio_openFile (const char *filename
, int *fd
, int flags
, int permissions
);
57 JNIEXPORT
int cpio_closeFile (int fd
);
58 JNIEXPORT
int cpio_availableBytes (int fd
, jlong
*avail
);
59 JNIEXPORT
int cpio_getFileSize (int fd
, jlong
*filesize
);
60 JNIEXPORT
int cpio_setFileSize (int fd
, jlong filesize
);
61 JNIEXPORT
int cpio_getFilePosition (int fd
, jlong
*position
);
62 JNIEXPORT
int cpio_setFilePosition (int fd
, jlong position
);
63 JNIEXPORT
int cpio_read (int fd
, void *data
, jint len
, jint
*bytes_read
);
64 JNIEXPORT
int cpio_write (int fd
, const void *data
, jint len
, jint
*bytes_written
);
65 JNIEXPORT
int cpio_fsync (int fd
);
66 JNIEXPORT
int cpio_truncate (int fd
, jlong size
);
67 JNIEXPORT
int cpio_closeOnExec(int fd
);
70 #define CPFILE_DIRECTORY 1
72 JNIEXPORT
int cpio_setFileReadonly (const char *filename
);
73 JNIEXPORT
int cpio_isFileExists (const char *filename
);
74 JNIEXPORT
int cpio_checkType (const char *filename
, jint
*entryType
);
75 JNIEXPORT
int cpio_getModificationTime (const char *filename
, jlong
*mtime
);
76 JNIEXPORT
int cpio_setModificationTime (const char *filename
, jlong mtime
);
77 JNIEXPORT
int cpio_removeFile (const char *filename
);
78 JNIEXPORT
int cpio_mkdir (const char *filename
);
79 JNIEXPORT
int cpio_rename (const char *old_name
, const char *new_name
);
81 JNIEXPORT
int cpio_openDir (const char *dirname
, void **handle
);
82 JNIEXPORT
int cpio_closeDir (void *handle
);
83 JNIEXPORT
int cpio_readDir (void *handle
, char *filename
);