RedHat: Remove potpourri.h from RedHat SPEC file manifest
[openafs.git] / src / vol / ntops.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  *
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
8  */
9
10 #ifndef _NTOPS_H_
11 #define _NTOPS_H_
12
13
14 /* We don't include Unix afssyscalls.h, so: */
15 #define VALID_INO(I) ((I != (__int64)-1) && (I != (__int64)0))
16
17 /* minimum size of string to hand to PrintInode */
18 #define AFS_INO_STR_LENGTH 32
19 typedef char afs_ino_str_t[AFS_INO_STR_LENGTH];
20
21 char *PrintInode(char *s, Inode ino);
22
23 /* Basic file operations */
24 extern FD_t nt_open(char *name, int flags, int mode);
25 extern int nt_close(FD_t fd);
26 extern int nt_write(FD_t fd, char *buf, size_t size);
27 extern int nt_read(FD_t fd, char *buf, size_t size);
28 extern int nt_pread(FD_t fd, void * buf, size_t count, afs_foff_t offset);
29 extern int nt_pwrite(FD_t fd, const void * buf, size_t count, afs_foff_t offset);
30 extern int nt_size(FD_t fd);
31 extern int nt_getFileCreationTime(FD_t fd, FILETIME * ftime);
32 extern int nt_setFileCreationTime(FD_t fd, FILETIME * ftime);
33 extern int nt_sync(int cdrive);
34 extern int nt_ftruncate(FD_t fd, int len);
35 extern int nt_fsync(FD_t fd);
36 extern int nt_seek(FD_t fd, int off, int where);
37 extern FILE *nt_fdopen(IHandle_t * h, char *fdperms);
38 extern int nt_unlink(char *name);
39
40 /* Inode operations */
41 extern Inode nt_MakeSpecIno(int type);
42 extern Inode nt_icreate(IHandle_t * h, char *p, afs_uint32 p1, afs_uint32 p2,
43                         afs_uint32 p3, afs_uint32 p4);
44 extern FD_t nt_iopen(IHandle_t * h);
45 extern int nt_irelease(IHandle_t * h);
46 int nt_iread(IHandle_t * h, int offset, char *buf, int size);
47 int nt_iwrite(IHandle_t * h, int offset, char *buf, int size);
48 extern int nt_dec(IHandle_t * h, Inode ino, int p1);
49 extern int nt_inc(IHandle_t * h, Inode ino, int p1);
50 extern int nt_GetLinkCount(FdHandle_t * h, Inode ino, int lockit);
51 int nt_ListAFSFiles(char *dev,
52                     int (*write_fun) (FILE * fp, struct ViceInodeInfo *,
53                                       char *dir, char *file), FILE * fp,
54                     int (*judge_fun) (struct ViceInodeInfo *, afs_uint32 vid, void *rock),
55                     afs_uint32 singleVolumeNumber, void *rock);
56 int ListViceInodes(char *devname, char *mountedOn, FILE *inodeFile,
57                    int (*judgeInode) (struct ViceInodeInfo * info, afs_uint32 vid, void *rock),
58                    afs_uint32 singleVolumeNumber, int *forcep, int forceR,
59                    char *wpath, void *rock);
60
61
62 int nt_HandleToName(char *name, IHandle_t * h);
63 char *nt_HandleToVolDir(char *name, IHandle_t * h);
64
65 extern int Testing;
66
67 #endif /* _NTOPS_H_ */