]> git.saurik.com Git - apple/security.git/blob - AppleCSPDL/KeySchema.m4
Security-30.1.tar.gz
[apple/security.git] / AppleCSPDL / KeySchema.m4
1 divert(-1)
2 changecom(/*, */)
3 /*
4 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
5 *
6 * The contents of this file constitute Original Code as defined in and are
7 * subject to the Apple Public Source License Version 1.2 (the 'License').
8 * You may not use this file except in compliance with the License. Please obtain
9 * a copy of the License at http://www.apple.com/publicsource and read it before
10 * using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
14 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
15 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
17 * specific language governing rights and limitations under the License.
18 */
19
20 define(`startClass',
21 `define(`indexIndex', 0)dnl
22 define(`class', $1)dnl
23 divert(1)dnl
24 // $1 `attribute numbers
25 enum
26 {'
27 divert(2)dnl
28 // $1 attributes
29 static const CSSM_DB_SCHEMA_ATTRIBUTE_INFO $1SchemaAttributeList[] =
30 {
31 divert(3)dnl
32 // $1 indices
33 static const CSSM_DB_SCHEMA_INDEX_INFO $1SchemaIndexList[] =
34 {')
35
36 define(`endClass',
37 `divert(1)dnl
38 };
39
40 divert(2)dnl
41 };
42
43 const uint32 class()SchemaAttributeCount = sizeof(class()SchemaAttributeList) / sizeof(CSSM_DB_SCHEMA_ATTRIBUTE_INFO);
44
45 divert(3)dnl
46 ` // Unique (primary) index'
47 undivert(5)
48 ` // Secondary indices'
49 undivert(6)dnl
50 };
51
52 const uint32 class()SchemaIndexCount = sizeof(class()SchemaIndexList) / sizeof(CSSM_DB_SCHEMA_INDEX_INFO);
53
54 undivert(4)dnl
55 divert(0)dnl
56 undivert(1)dnl
57 undivert(2)dnl
58 undivert(3)dnl')
59
60 define(`attributeBody',
61 `{
62 ifelse(index(`$1',`s'),-1,
63 ` CSSM_DB_ATTRIBUTE_NAME_AS_INTEGER,
64 {(char *)$3},',
65 ` CSSM_DB_ATTRIBUTE_NAME_AS_STRING,
66 {$4},')
67 CSSM_DB_ATTRIBUTE_FORMAT_$7
68 }')
69
70 define(`simpleAttribute',
71 `const CSSM_DB_ATTRIBUTE_INFO $2 =
72 attributeBody($*);
73 ')
74
75 define(`attribute',
76 `divert(1)dnl
77 $3,
78 divert(2)dnl
79 { $3, $4, { $5, $6 }, CSSM_DB_ATTRIBUTE_FORMAT_$7 },
80 divert(-1)
81 ifelse(index(`$1',`S'),-1,`',
82 `divert(4)dnl
83 simpleAttribute($*)
84 divert(-1)')dnl
85
86 ifelse(index(`$1',`U'),-1,`',
87 `divert(5)dnl
88 { $3, 0, CSSM_DB_INDEX_UNIQUE, CSSM_DB_INDEX_ON_ATTRIBUTE },
89 divert(-1)')dnl
90 ifelse(index(`$1',`I'),-1,`',
91 `define(`indexIndex', incr(indexIndex))dnl
92 divert(6)dnl
93 { $3, indexIndex(), CSSM_DB_INDEX_NONUNIQUE, CSSM_DB_INDEX_ON_ATTRIBUTE },
94 divert(-1)')')
95
96 /* Start of actual output */
97 divert(0)dnl
98 /*
99 * Generated by m4 from KeySchema.m4 please do not edit this file.
100 */
101
102 `#include "KeySchema.h"'
103
104 namespace KeySchema {
105
106 divert(-1)
107 startClass(Key)
108 attribute(` Ss', KeyClass, kKeyClass, "KeyClass", 0, NULL, UINT32)
109 attribute(` Ss', PrintName, kPrintName, "PrintName", 0, NULL, BLOB)
110 attribute(` Ss', Alias, kAlias, "Alias", 0, NULL, BLOB)
111 attribute(` Ss', Permanent, kPermanent, "Permanent", 0, NULL, UINT32)
112 attribute(` Ss', Private, kPrivate, "Private", 0, NULL, UINT32)
113 attribute(` Ss', Modifiable, kModifiable, "Modifiable", 0, NULL, UINT32)
114 attribute(`UISs', Label, kLabel, "Label", 0, NULL, BLOB)
115 attribute(`U Ss', ApplicationTag, kApplicationTag, "ApplicationTag", 0, NULL, BLOB)
116 attribute(`U Ss', KeyCreator, kKeyCreator, "KeyCreator", 0, NULL, BLOB)
117 attribute(`U Ss', KeyType, kKeyType, "KeyType", 0, NULL, UINT32)
118 attribute(`U Ss', KeySizeInBits, kKeySizeInBits, "KeySizeInBits", 0, NULL, UINT32)
119 attribute(`U Ss', EffectiveKeySize, kEffectiveKeySize, "EffectiveKeySize", 0, NULL, UINT32)
120 attribute(`U Ss', StartDate, kStartDate, "StartDate", 0, NULL, BLOB)
121 attribute(`U Ss', EndDate, kEndDate, "EndDate", 0, NULL, BLOB)
122 attribute(` Ss', Sensitive, kSensitive, "Sensitive", 0, NULL, UINT32)
123 attribute(` Ss', AlwaysSensitive, kAlwaysSensitive, "AlwaysSensitive", 0, NULL, UINT32)
124 attribute(` Ss', Extractable, kExtractable, "Extractable", 0, NULL, UINT32)
125 attribute(` Ss', NeverExtractable, kNeverExtractable, "NeverExtractable", 0, NULL, UINT32)
126 attribute(` ISs', Encrypt, kEncrypt, "Encrypt", 0, NULL, UINT32)
127 attribute(` ISs', Decrypt, kDecrypt, "Decrypt", 0, NULL, UINT32)
128 attribute(` ISs', Derive, kDerive, "Derive", 0, NULL, UINT32)
129 attribute(` ISs', Sign, kSign, "Sign", 0, NULL, UINT32)
130 attribute(` ISs', Verify, kVerify, "Verify", 0, NULL, UINT32)
131 attribute(` ISs', SignRecover, kSignRecover, "SignRecover", 0, NULL, UINT32)
132 attribute(` ISs', VerifyRecover, kVerifyRecover, "VerifyRecover", 0, NULL, UINT32)
133 attribute(` ISs', Wrap, kWrap, "Wrap", 0, NULL, UINT32)
134 attribute(` ISs', Unwrap, kUnwrap, "Unwrap", 0, NULL, UINT32)
135 endClass()
136
137 } // end namespace KeySchema