Deleted Added
full compact
ftree.c (90110) ftree.c (90113)
1/*-
2 * Copyright (c) 1992 Keith Muller.
3 * Copyright (c) 1992, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Keith Muller of the University of California, San Diego.
8 *

--- 26 unchanged lines hidden (view full) ---

35 * SUCH DAMAGE.
36 */
37
38#ifndef lint
39#if 0
40static char sccsid[] = "@(#)ftree.c 8.2 (Berkeley) 4/18/94";
41#endif
42static const char rcsid[] =
1/*-
2 * Copyright (c) 1992 Keith Muller.
3 * Copyright (c) 1992, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Keith Muller of the University of California, San Diego.
8 *

--- 26 unchanged lines hidden (view full) ---

35 * SUCH DAMAGE.
36 */
37
38#ifndef lint
39#if 0
40static char sccsid[] = "@(#)ftree.c 8.2 (Berkeley) 4/18/94";
41#endif
42static const char rcsid[] =
43 "$FreeBSD: head/bin/pax/ftree.c 90110 2002-02-02 06:48:10Z imp $";
43 "$FreeBSD: head/bin/pax/ftree.c 90113 2002-02-02 07:07:59Z imp $";
44#endif /* not lint */
45
46#include <sys/types.h>
47#include <sys/time.h>
48#include <sys/stat.h>
49#include <unistd.h>
50#include <string.h>
51#include <stdio.h>

--- 89 unchanged lines hidden (view full) ---

141 * ftree_add()
142 * add the arg to the linked list of files to process. Each will be
143 * processed by fts one at a time
144 * Return:
145 * 0 if added to the linked list, -1 if failed
146 */
147
148int
44#endif /* not lint */
45
46#include <sys/types.h>
47#include <sys/time.h>
48#include <sys/stat.h>
49#include <unistd.h>
50#include <string.h>
51#include <stdio.h>

--- 89 unchanged lines hidden (view full) ---

141 * ftree_add()
142 * add the arg to the linked list of files to process. Each will be
143 * processed by fts one at a time
144 * Return:
145 * 0 if added to the linked list, -1 if failed
146 */
147
148int
149ftree_add(register char *str, int chflg)
149ftree_add(char *str, int chflg)
150{
150{
151 register FTREE *ft;
152 register int len;
151 FTREE *ft;
152 int len;
153
154 /*
155 * simple check for bad args
156 */
157 if ((str == NULL) || (*str == '\0')) {
158 paxwarn(0, "Invalid file name argument");
159 return(-1);
160 }

--- 25 unchanged lines hidden (view full) ---

186
187/*
188 * ftree_sel()
189 * this entry has been selected by pax. bump up reference count and handle
190 * -n and -d processing.
191 */
192
193void
153
154 /*
155 * simple check for bad args
156 */
157 if ((str == NULL) || (*str == '\0')) {
158 paxwarn(0, "Invalid file name argument");
159 return(-1);
160 }

--- 25 unchanged lines hidden (view full) ---

186
187/*
188 * ftree_sel()
189 * this entry has been selected by pax. bump up reference count and handle
190 * -n and -d processing.
191 */
192
193void
194ftree_sel(register ARCHD *arcn)
194ftree_sel(ARCHD *arcn)
195{
196 /*
197 * set reference bit for this pattern. This linked list is only used
198 * when file trees are supplied pax as args. The list is not used when
199 * the trees are read from stdin.
200 */
201 if (ftcur != NULL)
202 ftcur->refcnt = 1;

--- 18 unchanged lines hidden (view full) ---

221 * ftree_chk()
222 * called at end on pax execution. Prints all those file args that did not
223 * have a selected member (reference count still 0)
224 */
225
226void
227ftree_chk(void)
228{
195{
196 /*
197 * set reference bit for this pattern. This linked list is only used
198 * when file trees are supplied pax as args. The list is not used when
199 * the trees are read from stdin.
200 */
201 if (ftcur != NULL)
202 ftcur->refcnt = 1;

--- 18 unchanged lines hidden (view full) ---

221 * ftree_chk()
222 * called at end on pax execution. Prints all those file args that did not
223 * have a selected member (reference count still 0)
224 */
225
226void
227ftree_chk(void)
228{
229 register FTREE *ft;
230 register int wban = 0;
229 FTREE *ft;
230 int wban = 0;
231
232 /*
233 * make sure all dir access times were reset.
234 */
235 if (tflag)
236 atdir_end();
237
238 /*

--- 19 unchanged lines hidden (view full) ---

258 * Return:
259 * 0 when the next arg is ready to go, -1 if out of file args (or EOF on
260 * stdin).
261 */
262
263static int
264ftree_arg(void)
265{
231
232 /*
233 * make sure all dir access times were reset.
234 */
235 if (tflag)
236 atdir_end();
237
238 /*

--- 19 unchanged lines hidden (view full) ---

258 * Return:
259 * 0 when the next arg is ready to go, -1 if out of file args (or EOF on
260 * stdin).
261 */
262
263static int
264ftree_arg(void)
265{
266 register char *pt;
266 char *pt;
267
268 /*
269 * close off the current file tree
270 */
271 if (ftsp != NULL) {
272 (void)fts_close(ftsp);
273 ftsp = NULL;
274 }

--- 55 unchanged lines hidden (view full) ---

330/*
331 * next_file()
332 * supplies the next file to process in the supplied archd structure.
333 * Return:
334 * 0 when contents of arcn have been set with the next file, -1 when done.
335 */
336
337int
267
268 /*
269 * close off the current file tree
270 */
271 if (ftsp != NULL) {
272 (void)fts_close(ftsp);
273 ftsp = NULL;
274 }

--- 55 unchanged lines hidden (view full) ---

330/*
331 * next_file()
332 * supplies the next file to process in the supplied archd structure.
333 * Return:
334 * 0 when contents of arcn have been set with the next file, -1 when done.
335 */
336
337int
338next_file(register ARCHD *arcn)
338next_file(ARCHD *arcn)
339{
339{
340 register int cnt;
340 int cnt;
341 time_t atime;
342 time_t mtime;
343
344 /*
345 * ftree_sel() might have set the ftree_skip flag if the user has the
346 * -n option and a file was selected from this file arg tree. (-n says
347 * only one member is matched for each pattern) ftree_skip being 1
348 * forces us to go to the next arg now.

--- 179 unchanged lines hidden ---
341 time_t atime;
342 time_t mtime;
343
344 /*
345 * ftree_sel() might have set the ftree_skip flag if the user has the
346 * -n option and a file was selected from this file arg tree. (-n says
347 * only one member is matched for each pattern) ftree_skip being 1
348 * forces us to go to the next arg now.

--- 179 unchanged lines hidden ---