2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #ifndef OPENAFS_FILEUTIL_H
11 #define OPENAFS_FILEUTIL_H
13 /* File-oriented utility functions */
16 renamefile(const char *oldname, const char *newname);
18 /* Path normalization routines */
19 #define FPN_FORWARD_SLASHES 1
20 #define FPN_BACK_SLASHES 2
23 FilepathNormalizeEx(char *path, int slashType);
25 /* Just a wrapper for FilepathNormalizeEx(path, FPN_FORWARD_SLASHES); */
27 FilepathNormalize(char *path);
30 * Data structure used to implement buffered I/O. We cannot
31 * use fopen in the fileserver because the file descriptor
32 * in the FILE structure only has 8 bits.
35 #define BUFIO_INVALID_FD (-1)
37 #define BUFIO_BUFSIZE 4096
44 char buf[BUFIO_BUFSIZE];
47 /* Open a file for buffered I/O */
49 BufioOpen(char *path, int oflag, int mode);
51 /* Read the next line of a file */
53 BufioGets(bufio_p bp, char *buf, int len);
55 /* Close a buffered I/O handle */
57 BufioClose(bufio_p bp);
59 #endif /* OPENAFS_FILEUTIL_H */