]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/ctm/ctm/ctm_syntax.c
Import Intel Processor Trace decoder library from
[FreeBSD/FreeBSD.git] / usr.sbin / ctm / ctm / ctm_syntax.c
1 /*-
2  * SPDX-License-Identifier: Beerware
3  *
4  * ----------------------------------------------------------------------------
5  * "THE BEER-WARE LICENSE" (Revision 42):
6  * <phk@FreeBSD.org> wrote this file.  As long as you retain this notice you
7  * can do whatever you want with this stuff. If we meet some day, and you think
8  * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
9  * ----------------------------------------------------------------------------
10  *
11  * $FreeBSD$
12  *
13  */
14
15 #include "ctm.h"
16
17 /* The fields... */
18 #define Name    CTM_F_Name
19 #define Uid     CTM_F_Uid
20 #define Gid     CTM_F_Gid
21 #define Mode    CTM_F_Mode
22 #define MD5     CTM_F_MD5
23 #define Count   CTM_F_Count
24 #define Bytes   CTM_F_Bytes
25
26 /* The qualifiers... */
27 #define File    CTM_Q_Name_File
28 #define Dir     CTM_Q_Name_Dir
29 #define New     CTM_Q_Name_New
30 #define Subst   CTM_Q_Name_Subst
31 #define After   CTM_Q_MD5_After
32 #define Before  CTM_Q_MD5_Before
33 #define Chunk   CTM_Q_MD5_Chunk
34 #define Force   CTM_Q_MD5_Force
35
36 static int ctmFM[] = /* File Make */
37     { Name|File|New|Subst, Uid, Gid, Mode,
38         MD5|After|Chunk, Count, Bytes,0 };
39
40 static int ctmFS[] = /* File Substitute */
41     { Name|File|Subst, Uid, Gid, Mode,
42         MD5|Before|Force, MD5|After|Chunk, Count, Bytes,0 };
43
44 static int ctmFE[] = /* File Edit */
45     { Name|File|Subst, Uid, Gid, Mode,
46         MD5|Before, MD5|After, Count, Bytes,0 };
47
48 static int ctmFR[] = /* File Remove */
49     { Name|File|Subst, MD5|Before, 0 };
50
51 static int ctmAS[] = /* Attribute Substitute */
52     { Name|Subst, Uid, Gid, Mode, 0 };
53
54 static int ctmDM[] = /* Directory Make */
55     { Name|Dir|New , Uid, Gid, Mode, 0 };
56
57 static int ctmDR[] = /* Directory Remove */
58     { Name|Dir, 0 };
59
60 struct CTM_Syntax Syntax[] = {
61     { "FM",     ctmFM },
62     { "FS",     ctmFS },
63     { "FE",     ctmFE },
64     { "FN",     ctmFE },
65     { "FR",     ctmFR },
66     { "AS",     ctmAS },
67     { "DM",     ctmDM },
68     { "DR",     ctmDR },
69     { 0,        0} };