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