1f08c3bdfSopenharmony_ci/*
2f08c3bdfSopenharmony_ci *
3f08c3bdfSopenharmony_ci *   Copyright (c) International Business Machines  Corp., 2002
4f08c3bdfSopenharmony_ci *
5f08c3bdfSopenharmony_ci *   This program is free software;  you can redistribute it and/or modify
6f08c3bdfSopenharmony_ci *   it under the terms of the GNU General Public License as published by
7f08c3bdfSopenharmony_ci *   the Free Software Foundation; either version 2 of the License, or
8f08c3bdfSopenharmony_ci *   (at your option) any later version.
9f08c3bdfSopenharmony_ci *
10f08c3bdfSopenharmony_ci *   This program is distributed in the hope that it will be useful,
11f08c3bdfSopenharmony_ci *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
12f08c3bdfSopenharmony_ci *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
13f08c3bdfSopenharmony_ci *   the GNU General Public License for more details.
14f08c3bdfSopenharmony_ci *
15f08c3bdfSopenharmony_ci *   You should have received a copy of the GNU General Public License
16f08c3bdfSopenharmony_ci *   along with this program;  if not, write to the Free Software
17f08c3bdfSopenharmony_ci *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18f08c3bdfSopenharmony_ci */
19f08c3bdfSopenharmony_ci
20f08c3bdfSopenharmony_ci/* 10/31/2002   Port to LTP     robbiew@us.ibm.com */
21f08c3bdfSopenharmony_ci/* 06/30/2001   Port to Linux   nsharoff@us.ibm.com */
22f08c3bdfSopenharmony_ci
23f08c3bdfSopenharmony_ci
24f08c3bdfSopenharmony_ci/*
25f08c3bdfSopenharmony_ci * NAME
26f08c3bdfSopenharmony_ci *	nftw64.h - Header file for nftw64.c
27f08c3bdfSopenharmony_ci */
28f08c3bdfSopenharmony_ci
29f08c3bdfSopenharmony_ci
30f08c3bdfSopenharmony_ci#ifndef _NFTW_H_
31f08c3bdfSopenharmony_ci#define _NFTW_H_
32f08c3bdfSopenharmony_ci
33f08c3bdfSopenharmony_ci#include <stdlib.h>
34f08c3bdfSopenharmony_ci#include <ftw.h>
35f08c3bdfSopenharmony_ci#include <unistd.h>
36f08c3bdfSopenharmony_ci#include <fcntl.h>
37f08c3bdfSopenharmony_ci#include <string.h>
38f08c3bdfSopenharmony_ci#include <dirent.h>
39f08c3bdfSopenharmony_ci#include <sys/stat.h>
40f08c3bdfSopenharmony_ci#include <sys/wait.h>
41f08c3bdfSopenharmony_ci#include <sys/types.h>
42f08c3bdfSopenharmony_ci#include <limits.h>
43f08c3bdfSopenharmony_ci#include <errno.h>
44f08c3bdfSopenharmony_ci#include <setjmp.h>
45f08c3bdfSopenharmony_ci#include <stdio.h>
46f08c3bdfSopenharmony_ci
47f08c3bdfSopenharmony_ci#include "test.h"
48f08c3bdfSopenharmony_ci
49f08c3bdfSopenharmony_ci#define STRLEN          512
50f08c3bdfSopenharmony_ci#define MAX_FD          20
51f08c3bdfSopenharmony_ci#define MAXOPENDIRS     1024    /* max opendirs to try to exhaust dir streams */
52f08c3bdfSopenharmony_ci#define NUM_2_VISIT     4
53f08c3bdfSopenharmony_ci#define RET_VAL         666
54f08c3bdfSopenharmony_ci#define NDIRLISTENTS    100
55f08c3bdfSopenharmony_ci#define ERR_BUF_SIZ     4096
56f08c3bdfSopenharmony_ci#define NFTW            "./tmp/data"
57f08c3bdfSopenharmony_ci#define NFTW2           "/tmp/data"
58f08c3bdfSopenharmony_ci#define LINK_CNT        13
59f08c3bdfSopenharmony_ci#define NO_LINK_CNT     7
60f08c3bdfSopenharmony_ci#define DIR             0
61f08c3bdfSopenharmony_ci#define REG             1
62f08c3bdfSopenharmony_ci#define SYM             2
63f08c3bdfSopenharmony_ci
64f08c3bdfSopenharmony_citypedef struct pathdata {
65f08c3bdfSopenharmony_ci        char    name[PATH_MAX];
66f08c3bdfSopenharmony_ci        mode_t  mode;
67f08c3bdfSopenharmony_ci        int     type;
68f08c3bdfSopenharmony_ci        char    contents[STRLEN];
69f08c3bdfSopenharmony_ci} pathdata;
70f08c3bdfSopenharmony_ci
71f08c3bdfSopenharmony_cistruct list {
72f08c3bdfSopenharmony_ci	char	*s;
73f08c3bdfSopenharmony_ci	int	 i;
74f08c3bdfSopenharmony_ci};
75f08c3bdfSopenharmony_ci
76f08c3bdfSopenharmony_ciextern void fail_exit(void);
77f08c3bdfSopenharmony_ci
78f08c3bdfSopenharmony_ci/* These functions are found in test.c */
79f08c3bdfSopenharmony_ciextern void test1A(void);
80f08c3bdfSopenharmony_ciextern void test2A(void);
81f08c3bdfSopenharmony_ciextern void test3A(void);
82f08c3bdfSopenharmony_ciextern void test4A(void);
83f08c3bdfSopenharmony_ciextern void test5A(void);
84f08c3bdfSopenharmony_ciextern void test6A(void);
85f08c3bdfSopenharmony_ciextern void test7A(void);
86f08c3bdfSopenharmony_ciextern void test8A(void);
87f08c3bdfSopenharmony_ciextern void test9A(void);
88f08c3bdfSopenharmony_ciextern void test10A(void);
89f08c3bdfSopenharmony_ciextern void test11A(void);
90f08c3bdfSopenharmony_ciextern void test12A(void);
91f08c3bdfSopenharmony_ciextern void test13A(void);
92f08c3bdfSopenharmony_ciextern void test14A(void);
93f08c3bdfSopenharmony_ciextern void test15A(void);
94f08c3bdfSopenharmony_ciextern void test16A(void);
95f08c3bdfSopenharmony_ciextern void test17A(void);
96f08c3bdfSopenharmony_ciextern void test18A(void);
97f08c3bdfSopenharmony_ciextern void test19A(void);
98f08c3bdfSopenharmony_ciextern void test20A(void);
99f08c3bdfSopenharmony_ciextern void test21A(void);
100f08c3bdfSopenharmony_ciextern void test22A(void);
101f08c3bdfSopenharmony_ciextern void test23A(void);
102f08c3bdfSopenharmony_ciextern void test24A(void);
103f08c3bdfSopenharmony_ciextern void test25A(void);
104f08c3bdfSopenharmony_ciextern void test26A(void);
105f08c3bdfSopenharmony_ciextern void test27A(void);
106f08c3bdfSopenharmony_ciextern void test28A(void);
107f08c3bdfSopenharmony_ciextern void test29A(void);
108f08c3bdfSopenharmony_ciextern void test30A(void);
109f08c3bdfSopenharmony_ci
110f08c3bdfSopenharmony_ci/* These functions are found in test_func.c */
111f08c3bdfSopenharmony_ciextern int test_func1(const char *, const struct stat64 *, int, struct FTW *);
112f08c3bdfSopenharmony_ciextern int test_func3(const char *, const struct stat64 *, int, struct FTW *);
113f08c3bdfSopenharmony_ciextern int test_func4(const char *, const struct stat64 *, int, struct FTW *);
114f08c3bdfSopenharmony_ciextern int test_func5(const char *, const struct stat64 *, int, struct FTW *);
115f08c3bdfSopenharmony_ciextern int test_func7(const char *, const struct stat64 *, int, struct FTW *);
116f08c3bdfSopenharmony_ciextern int test_func8(const char *, const struct stat64 *, int, struct FTW *);
117f08c3bdfSopenharmony_ciextern int test_func9(const char *, const struct stat64 *, int, struct FTW *);
118f08c3bdfSopenharmony_ciextern int test_func10(const char *, const struct stat64 *, int, struct FTW *);
119f08c3bdfSopenharmony_ciextern int test_func11(const char *, const struct stat64 *, int, struct FTW *);
120f08c3bdfSopenharmony_ciextern int test_func12(const char *, const struct stat64 *, int, struct FTW *);
121f08c3bdfSopenharmony_ciextern int test_func13(const char *, const struct stat64 *, int, struct FTW *);
122f08c3bdfSopenharmony_ciextern int test_func14(const char *, const struct stat64 *, int, struct FTW *);
123f08c3bdfSopenharmony_ciextern int test_func15(const char *, const struct stat64 *, int, struct FTW *);
124f08c3bdfSopenharmony_ciextern int test_func16(const char *, const struct stat64 *, int, struct FTW *);
125f08c3bdfSopenharmony_ciextern int test_func17(const char *, const struct stat64 *, int, struct FTW *);
126f08c3bdfSopenharmony_ciextern int test_func18(const char *, const struct stat64 *, int, struct FTW *);
127f08c3bdfSopenharmony_ciextern int test_func19(const char *, const struct stat64 *, int, struct FTW *);
128f08c3bdfSopenharmony_ciextern int test_func20(const char *, const struct stat64 *, int, struct FTW *);
129f08c3bdfSopenharmony_ciextern int test_func21(const char *, const struct stat64 *, int, struct FTW *);
130f08c3bdfSopenharmony_ciextern int test_func22(const char *, const struct stat64 *, int, struct FTW *);
131f08c3bdfSopenharmony_ciextern int test_func23(const char *, const struct stat64 *, int, struct FTW *);
132f08c3bdfSopenharmony_ci
133f08c3bdfSopenharmony_ci/* These functions are found in tools.c */
134f08c3bdfSopenharmony_ciextern void cleanup_function(void);
135f08c3bdfSopenharmony_ciextern void setup_path(void);
136f08c3bdfSopenharmony_ciextern int nftw64_fn(const char *, const struct stat64 *, int, struct FTW *);
137f08c3bdfSopenharmony_ciextern char * ftw_mnemonic(int);
138f08c3bdfSopenharmony_ciextern int getbase(const char *);
139f08c3bdfSopenharmony_ciextern int getlev(const char *);
140f08c3bdfSopenharmony_ciextern void do_info(const char *);
141f08c3bdfSopenharmony_ci
142f08c3bdfSopenharmony_ci/* These functions are found in lib.c */
143f08c3bdfSopenharmony_ciextern void remove_test_ENOTDIR_files(void);
144f08c3bdfSopenharmony_ciextern void remove_test_ENOENT_files(void);
145f08c3bdfSopenharmony_ciextern void test_ENAMETOOLONG_path(char *, int (*)(const char *), int);
146f08c3bdfSopenharmony_ciextern void test_ENAMETOOLONG_name(char *, int (*)(const char *), int);
147f08c3bdfSopenharmony_ciextern void test_ENOENT_empty(char *, int (*)(const char *), int);
148f08c3bdfSopenharmony_ciextern void test_ENOTDIR(char *, int (*)(const char *), int);
149f08c3bdfSopenharmony_ciextern void test_ENOENT_nofile(char *, int (*)(const char *), int);
150f08c3bdfSopenharmony_ci
151f08c3bdfSopenharmony_ci
152f08c3bdfSopenharmony_ci#endif	/* _NFTW_H_ */
153