3 * $Id: fattr.h,v 1.1 1999/07/26 23:33:56 mdw Exp $
5 * Handling of file attributes
7 * (c) 1999 Straylight/Edgeware
10 /*----- Licensing notice --------------------------------------------------*
12 * This file is part of the `fw' port forwarder.
14 * `fw' is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * `fw' is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with `fw'; if not, write to the Free Software Foundation,
26 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 /*----- Revision history --------------------------------------------------*
32 * Revision 1.1 1999/07/26 23:33:56 mdw
33 * Support code for new design.
44 /*----- Header files ------------------------------------------------------*/
48 #include <sys/types.h>
52 /*----- Data structures ---------------------------------------------------*/
54 typedef struct fattr {
60 /*----- Global variables --------------------------------------------------*/
62 extern fattr fattr_global;
64 /*----- Functions provided ------------------------------------------------*/
66 /* --- @fattr_init@ --- *
68 * Arguments: @fattr *f@ = pointer to file attributes
72 * Use: Initializes a set of file attributes to default values.
75 extern void fattr_init(fattr */*f*/);
77 /* --- @fattr_option@ --- *
79 * Arguments: @scanner *sc@ = pointer to scanner to read
80 * @fattr *f@ = pointer to file attributes to set
82 * Returns: Whether the option was clamed.
84 * Use: Reads file attributes from a scanner.
87 extern int fattr_option(scanner */*sc*/, fattr */*f*/);
89 /* --- @fattr_apply@ --- *
91 * Arguments: @const char *file@ = pointer to filename
92 * @fattr *f@ = pointer to attribute set
94 * Returns: @-1@ if it failed.
96 * Use: Applies file attributes to a file. For best results, try to
97 * create the file with the right permissions and so on. This
98 * call will fix everything up, but there are potential races
99 * which might catch you out if you're not careful.
102 extern int fattr_apply(const char */*file*/, fattr */*f*/);
104 /*----- That's all, folks -------------------------------------------------*/