1 | /* $Id: kbuild_protection.h 2019 2008-11-02 00:21:05Z bird $ */
|
---|
2 | /** @file
|
---|
3 | * Simple File Protection.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (c) 2008 knut st. osmundsen <[email protected]>
|
---|
8 | *
|
---|
9 | * This file is part of kBuild.
|
---|
10 | *
|
---|
11 | * kBuild is free software; you can redistribute it and/or modify
|
---|
12 | * it under the terms of the GNU General Public License as published by
|
---|
13 | * the Free Software Foundation; either version 3 of the License, or
|
---|
14 | * (at your option) any later version.
|
---|
15 | *
|
---|
16 | * kBuild is distributed in the hope that it will be useful,
|
---|
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
19 | * GNU General Public License for more details.
|
---|
20 | *
|
---|
21 | * You should have received a copy of the GNU General Public License
|
---|
22 | * along with kBuild. If not, see <http://www.gnu.org/licenses/>
|
---|
23 | *
|
---|
24 | */
|
---|
25 |
|
---|
26 | #ifndef ___kbuild_protection_h
|
---|
27 | #define ___kbuild_protection_h
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * The different protection types.
|
---|
31 | */
|
---|
32 | typedef enum
|
---|
33 | {
|
---|
34 | KBUILDPROTECTIONTYPE_FIRST = 0,
|
---|
35 | KBUILDPROTECTIONTYPE_RECURSIVE = KBUILDPROTECTIONTYPE_FIRST,
|
---|
36 | KBUILDPROTECTIONTYPE_FULL,
|
---|
37 | KBUILDPROTECTIONTYPE_MAX
|
---|
38 | } KBUILDPROTECTIONTYPE;
|
---|
39 |
|
---|
40 |
|
---|
41 | /**
|
---|
42 | * The instance data.
|
---|
43 | * Don't touch.
|
---|
44 | */
|
---|
45 | typedef struct KBUILDPROTECTION
|
---|
46 | {
|
---|
47 | unsigned int uMagic;
|
---|
48 | unsigned int cProtectionDepth;
|
---|
49 | unsigned char afTypes[KBUILDPROTECTIONTYPE_MAX];
|
---|
50 | } KBUILDPROTECTION;
|
---|
51 | typedef KBUILDPROTECTION *PKBUILDPROTECTION;
|
---|
52 | typedef const KBUILDPROTECTION *PCKBUILDPROTECTION;
|
---|
53 |
|
---|
54 |
|
---|
55 | void kBuildProtectionInit(PKBUILDPROTECTION pThis);
|
---|
56 | void kBuildProtectionTerm(PKBUILDPROTECTION pThis);
|
---|
57 | int kBuildProtectionScanEnv(PKBUILDPROTECTION pThis, char **papszEnv, const char *pszPrefix);
|
---|
58 | void kBuildProtectionEnable(PKBUILDPROTECTION pThis, KBUILDPROTECTIONTYPE enmType);
|
---|
59 | void kBuildProtectionDisable(PKBUILDPROTECTION pThis, KBUILDPROTECTIONTYPE enmType);
|
---|
60 | int kBuildProtectionSetDepth(PKBUILDPROTECTION pThis, const char *pszValue);
|
---|
61 | int kBuildProtectionEnforce(PCKBUILDPROTECTION pThis, KBUILDPROTECTIONTYPE enmType, const char *pszPath);
|
---|
62 | int kBuildProtectionDefaultDepth(void);
|
---|
63 |
|
---|
64 | #endif
|
---|
65 |
|
---|