Changeset 2985 for trunk/src/lib/nt/fts-nt.h
- Timestamp:
- Nov 1, 2016, 7:26:35 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/nt/fts-nt.h
r2983 r2985 1 /* $Id: $ */ 2 /** @file 3 * Header for the NT port of BSD fts.h. 4 * 5 * @copyright Copyright (c) 1989, 1993 The Regents of the University of California. All rights reserved. 6 * @copyright NT modifications Copyright (C) 2016 knut st. osmundsen <bird-klibc-spam-xiv@anduin.net> 7 * @licenses BSD3 8 */ 9 1 10 /* 2 11 * Copyright (c) 1989, 1993 … … 29 38 * @(#)fts.h 8.3 (Berkeley) 8/14/94 30 39 * $FreeBSD$ 40 * 31 41 */ 32 42 33 #ifndef _FTS_H_34 #define _FTS_H_43 #ifndef INCLUDED_FTS_NT_H 44 #define INCLUDED_FTS_NT_H 35 45 36 #include <sys/_types.h> 46 #include <sys/types.h> 47 #include <stdint.h> 48 #include "ntstat.h" /* ensure correct stat structure */ 49 50 typedef uint64_t fts_dev_t; 51 typedef uint64_t fts_ino_t; 52 typedef uint32_t fts_nlink_t; 53 #ifdef _WINNT_ 54 typedef HANDLE fts_fd_t; 55 #else 56 typedef void * fts_fd_t; 57 #endif 58 #define FTSCALL __cdecl 37 59 38 60 typedef struct { … … 40 62 struct _ftsent *fts_child; /* linked list of children */ 41 63 struct _ftsent **fts_array; /* sort array */ 42 __dev_t fts_dev; /* starting device # */64 fts_dev_t fts_dev; /* starting device # */ 43 65 char *fts_path; /* path for this descent */ 44 int fts_rfd; /* fd for root */ 45 __size_t fts_pathlen; /* sizeof(path) */ 46 __size_t fts_nitems; /* elements in the sort array */ 47 int (*fts_compar) /* compare function */ 66 size_t fts_pathlen; /* sizeof(path) */ 67 size_t fts_nitems; /* elements in the sort array */ 68 int (FTSCALL *fts_compar) /* compare function */ 48 69 (const struct _ftsent * const *, const struct _ftsent * const *); 49 70 … … 55 76 #define FTS_SEEDOT 0x020 /* return dot and dot-dot */ 56 77 #define FTS_XDEV 0x040 /* don't cross devices */ 78 #if 0 /* No whiteout on NT. */ 57 79 #define FTS_WHITEOUT 0x080 /* return whiteout information */ 80 #endif 58 81 #define FTS_OPTIONMASK 0x0ff /* valid user option mask */ 59 82 … … 68 91 struct _ftsent *fts_parent; /* parent directory */ 69 92 struct _ftsent *fts_link; /* next file in directory */ 70 long longfts_number; /* local numeric value */93 int64_t fts_number; /* local numeric value */ 71 94 #define fts_bignum fts_number /* XXX non-std, should go away */ 72 95 void *fts_pointer; /* local address value */ … … 74 97 char *fts_path; /* root path */ 75 98 int fts_errno; /* errno for this node */ 76 int fts_symfd; /* fd for symlink */ 77 __size_t fts_pathlen; /* strlen(fts_path) */ 78 __size_t fts_namelen; /* strlen(fts_name) */ 99 fts_fd_t fts_symfd; /* NT: Normally -1; -2 we followed this symlinked dir */ 100 fts_fd_t fts_dirfd; /* NT: Handle to the directory */ 101 size_t fts_pathlen; /* strlen(fts_path) */ 102 size_t fts_namelen; /* strlen(fts_name) */ 79 103 80 __ino_t fts_ino; /* inode */81 __dev_t fts_dev; /* device */82 __nlink_t fts_nlink; /* link count */104 fts_ino_t fts_ino; /* inode */ 105 fts_dev_t fts_dev; /* device */ 106 fts_nlink_t fts_nlink; /* link count */ 83 107 84 108 #define FTS_ROOTPARENTLEVEL -1 … … 99 123 #define FTS_SL 12 /* symbolic link */ 100 124 #define FTS_SLNONE 13 /* symbolic link without target */ 101 #define FTS_W 14 /* whiteout object */125 //#define FTS_W 14 /* whiteout object */ 102 126 int fts_info; /* user status for FTSENT structure */ 103 127 … … 116 140 char *fts_name; /* file name */ 117 141 FTS *fts_fts; /* back pointer to main FTS */ 142 BirdStat_T fts_stat; /* NT: We always got stat info. */ 118 143 } FTSENT; 119 144 120 #include <sys/cdefs.h>121 145 122 __BEGIN_DECLS 123 FTSENT *fts_children(FTS *, int); 124 int fts_close(FTS *); 125 void *fts_get_clientptr(FTS *); 146 #ifdef __cplusplus 147 extern "C" { 148 #endif 149 FTSENT *FTSCALL fts_children(FTS *, int); 150 int FTSCALL fts_close(FTS *); 151 void *FTSCALL fts_get_clientptr(FTS *); 126 152 #define fts_get_clientptr(fts) ((fts)->fts_clientptr) 127 FTS * fts_get_stream(FTSENT *);153 FTS *FTSCALL fts_get_stream(FTSENT *); 128 154 #define fts_get_stream(ftsent) ((ftsent)->fts_fts) 129 FTS *fts_open(char * const *, int, 130 int (*)(const FTSENT * const *, const FTSENT * const *)); 131 FTSENT *fts_read(FTS *); 132 int fts_set(FTS *, FTSENT *, int); 133 void fts_set_clientptr(FTS *, void *); 134 __END_DECLS 155 FTS *FTSCALL fts_open(char * const *, int, 156 int (FTSCALL*)(const FTSENT * const *, const FTSENT * const *)); 157 FTSENT *FTSCALL fts_read(FTS *); 158 int FTSCALL fts_set(FTS *, FTSENT *, int); 159 void FTSCALL fts_set_clientptr(FTS *, void *); 160 #ifdef __cplusplus 161 } 162 #endif 135 163 136 #endif /* !_FTS_H_ */ 164 #endif /* !INCLUDED_FTS_NT_H */ 165
Note:
See TracChangeset
for help on using the changeset viewer.