1 /* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 3. Neither the name of the University nor the names of its contributors 14 * may be used to endorse or promote products derived from this software 15 * without specific prior written permission. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)fts.h 8.3 (Berkeley) 8/14/94 30 */ 31 32 #ifndef _FTS_COPMAT11_H_ 33 #define _FTS_COPMAT11_H_ 34 35 typedef struct { 36 struct _ftsent11 *fts_cur; /* current node */ 37 struct _ftsent11 *fts_child; /* linked list of children */ 38 struct _ftsent11 **fts_array; /* sort array */ 39 uint32_t fts_dev; /* starting device # */ 40 char *fts_path; /* path for this descent */ 41 int fts_rfd; /* fd for root */ 42 __size_t fts_pathlen; /* sizeof(path) */ 43 __size_t fts_nitems; /* elements in the sort array */ 44 int (*fts_compar) /* compare function */ 45 (const struct _ftsent11 * const *, 46 const struct _ftsent11 * const *); 47 int fts_options; /* fts_open options, global flags */ 48 void *fts_clientptr; /* thunk for sort function */ 49 } FTS11; 50 51 typedef struct _ftsent11 { 52 struct _ftsent11 *fts_cycle; /* cycle node */ 53 struct _ftsent11 *fts_parent; /* parent directory */ 54 struct _ftsent11 *fts_link; /* next file in directory */ 55 long long fts_number; /* local numeric value */ 56 void *fts_pointer; /* local address value */ 57 char *fts_accpath; /* access path */ 58 char *fts_path; /* root path */ 59 int fts_errno; /* errno for this node */ 60 int fts_symfd; /* fd for symlink */ 61 __size_t fts_pathlen; /* strlen(fts_path) */ 62 __size_t fts_namelen; /* strlen(fts_name) */ 63 64 uint32_t fts_ino; /* inode */ 65 uint32_t fts_dev; /* device */ 66 uint16_t fts_nlink; /* link count */ 67 68 long fts_level; /* depth (-1 to N) */ 69 70 int fts_info; /* user status for FTSENT structure */ 71 72 unsigned fts_flags; /* private flags for FTSENT structure */ 73 74 int fts_instr; /* fts_set() instructions */ 75 76 struct freebsd11_stat *fts_statp; /* stat(2) information */ 77 char *fts_name; /* file name */ 78 FTS11 *fts_fts; /* back pointer to main FTS */ 79 } FTSENT11; 80 81 FTSENT11 *freebsd11_fts_children(FTS11 *, int); 82 int freebsd11_fts_close(FTS11 *); 83 void *freebsd11_fts_get_clientptr(FTS11 *); 84 #define freebsd11_fts_get_clientptr(fts) ((fts)->fts_clientptr) 85 FTS11 *freebsd11_fts_get_stream(FTSENT11 *); 86 #define freebsd11_fts_get_stream(ftsent) ((ftsent)->fts_fts) 87 FTS11 *freebsd11_fts_open(char * const *, int, 88 int (*)(const FTSENT11 * const *, 89 const FTSENT11 * const *)); 90 FTSENT11 *freebsd11_fts_read(FTS11 *); 91 int freebsd11_fts_set(FTS11 *, FTSENT11 *, int); 92 void freebsd11_fts_set_clientptr(FTS11 *, void *); 93 94 #endif /* !_FTS_COMPAT11_H_ */ 95