Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:19

0001 /* $NetBSD: extern.h,v 1.12 2005/10/15 18:22:18 christos Exp $ */
0002 
0003 /*-
0004  * Copyright (c) 1991, 1993, 1994
0005  *  The Regents of the University of California.  All rights reserved.
0006  *
0007  * Redistribution and use in source and binary forms, with or without
0008  * modification, are permitted provided that the following conditions
0009  * are met:
0010  * 1. Redistributions of source code must retain the above copyright
0011  *    notice, this list of conditions and the following disclaimer.
0012  * 2. Redistributions in binary form must reproduce the above copyright
0013  *    notice, this list of conditions and the following disclaimer in the
0014  *    documentation and/or other materials provided with the distribution.
0015  * 3. Neither the name of the University nor the names of its contributors
0016  *    may be used to endorse or promote products derived from this software
0017  *    without specific prior written permission.
0018  *
0019  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
0020  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0021  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0022  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
0023  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
0024  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
0025  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
0026  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
0027  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
0028  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
0029  * SUCH DAMAGE.
0030  *
0031  *  @(#)extern.h    8.2 (Berkeley) 4/1/94
0032  */
0033 
0034 #ifndef _EXTERN_CP_H_
0035 #define _EXTERN_CP_H_
0036 
0037 #define PATH_T       RTEMS_SHELL_CP_PATH_T
0038 
0039 typedef struct {
0040     char *p_end;            /* pointer to NULL at end of path */
0041     char *target_end;       /* pointer to end of target base */
0042     char p_path[MAXPATHLEN + 1];    /* pointer to the start of a path */
0043 } PATH_T;
0044 
0045 #include <setjmp.h>
0046 #include <rtems.h>
0047 
0048 typedef struct {
0049   PATH_T to;
0050   int info;
0051   uid_t myuid;
0052   int fflag, iflag, lflag, nflag, pflag, vflag;
0053   mode_t myumask;
0054   jmp_buf exit_jmp;
0055 } rtems_shell_cp_globals;
0056 
0057 #define to           cp_globals->to
0058 #define info         cp_globals->info
0059 #define myuid        cp_globals->myuid
0060 #define fflag        cp_globals->fflag
0061 #define iflag        cp_globals->iflag
0062 #define lflag        cp_globals->lflag
0063 #define nflag        cp_globals->nflag
0064 #define pflag        cp_globals->pflag
0065 #define vflag        cp_globals->vflag
0066 #define myumask      cp_globals->myumask
0067 #define exit_jump    &(cp_globals->exit_jmp)
0068 
0069 #define copy_fifo    rtems_shell_cp_copy_fifo
0070 #define copy_file    rtems_shell_cp_copy_file
0071 #define copy_link    rtems_shell_cp_copy_link
0072 #define copy_special rtems_shell_cp_copy_special
0073 #define set_utimes   rtems_shell_cp_set_utimes
0074 #define setfile      rtems_shell_cp_setfile
0075 #define usage        rtems_shell_cp_usage
0076 
0077 #include <sys/cdefs.h>
0078 
0079 __BEGIN_DECLS
0080 int copy_fifo(rtems_shell_cp_globals* cp_globals, struct stat *, int);
0081 int copy_file(rtems_shell_cp_globals* cp_globals, FTSENT *, int);
0082 int copy_link(rtems_shell_cp_globals* cp_globals, FTSENT *, int);
0083 int copy_special(rtems_shell_cp_globals* cp_globals, struct stat *, int);
0084 int set_utimes(const char *, struct stat *);
0085 int setfile(rtems_shell_cp_globals* cp_globals, struct stat *, int);
0086 int preserve_dir_acls(struct stat *, char *, char *);
0087 int preserve_fd_acls(int, int);
0088 void usage(rtems_shell_cp_globals* cp_globals);
0089 
0090 __END_DECLS
0091 
0092 #endif /* !_EXTERN_H_ */