cauterize 0.0.1.pre1 → 0.0.1.pre5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. data/.gitignore +5 -0
  2. data/.rspec +1 -1
  3. data/Gemfile +1 -1
  4. data/README.md +0 -2
  5. data/Rakefile +19 -3
  6. data/bin/cauterize +14 -6
  7. data/example/Cauterize +22 -10
  8. data/example/build.sh +15 -2
  9. data/lib/cauterize/base_type.rb +2 -5
  10. data/lib/cauterize/builders.rb +1 -3
  11. data/lib/cauterize/builders/c/buildable.rb +3 -2
  12. data/lib/cauterize/builders/c/builtin.rb +46 -0
  13. data/lib/cauterize/builders/c/enumeration.rb +23 -2
  14. data/lib/cauterize/builders/c/fixed_array.rb +16 -7
  15. data/lib/cauterize/builders/c/group.rb +32 -3
  16. data/lib/cauterize/builders/c/scalar.rb +5 -0
  17. data/lib/cauterize/builders/c/variable_array.rb +1 -1
  18. data/lib/cauterize/builders/cs/buildable.rb +59 -0
  19. data/lib/cauterize/builders/cs/builtin.rb +23 -0
  20. data/lib/cauterize/builders/cs/composite.rb +21 -0
  21. data/lib/cauterize/builders/cs/csarray.rb +32 -0
  22. data/lib/cauterize/builders/cs/enumeration.rb +21 -0
  23. data/lib/cauterize/builders/cs/fixed_array.rb +25 -0
  24. data/lib/cauterize/builders/cs/group.rb +33 -0
  25. data/lib/cauterize/builders/cs/scalar.rb +10 -0
  26. data/lib/cauterize/builders/cs/variable_array.rb +34 -0
  27. data/lib/cauterize/builtin.rb +52 -0
  28. data/lib/cauterize/c_builder.rb +15 -1
  29. data/lib/cauterize/cauterize.rb +44 -13
  30. data/lib/cauterize/composite.rb +3 -3
  31. data/lib/cauterize/cs_builder.rb +53 -0
  32. data/lib/cauterize/enumeration.rb +20 -3
  33. data/lib/cauterize/fixed_array.rb +3 -3
  34. data/lib/cauterize/formatter.rb +7 -3
  35. data/lib/cauterize/group.rb +5 -8
  36. data/lib/cauterize/scalar.rb +16 -7
  37. data/lib/cauterize/variable_array.rb +6 -6
  38. data/lib/cauterize/version.rb +1 -1
  39. data/spec/base_type_spec.rb +133 -125
  40. data/spec/builders/c/buildable_spec.rb +18 -18
  41. data/spec/builders/c/builtin_spec.rb +22 -0
  42. data/spec/builders/c/composite_spec.rb +37 -33
  43. data/spec/builders/c/enumeration_spec.rb +84 -21
  44. data/spec/builders/c/fixed_array_spec.rb +6 -6
  45. data/spec/builders/c/group_spec.rb +97 -90
  46. data/spec/builders/c/scalar_spec.rb +24 -6
  47. data/spec/builders/c/variable_array_spec.rb +37 -37
  48. data/spec/builders/cs/buildable_spec.rb +8 -0
  49. data/spec/builders/cs/composite_spec.rb +32 -0
  50. data/spec/builders/cs/enumeration_spec.rb +33 -0
  51. data/spec/builders/cs/fixed_array_spec.rb +40 -0
  52. data/spec/builders/cs/group_spec.rb +56 -0
  53. data/spec/builders/cs/scalar_spec.rb +7 -0
  54. data/spec/builders/cs/variable_array_spec.rb +46 -0
  55. data/spec/builders_spec.rb +38 -38
  56. data/spec/builtin_spec.rb +46 -0
  57. data/spec/c_builder_spec.rb +116 -102
  58. data/spec/cauterize_spec.rb +8 -1
  59. data/spec/composite_spec.rb +52 -48
  60. data/spec/cs_builder_spec.rb +113 -0
  61. data/spec/enumeration_spec.rb +55 -16
  62. data/spec/fixed_array_spec.rb +7 -9
  63. data/spec/group_spec.rb +81 -76
  64. data/spec/scalar_spec.rb +20 -10
  65. data/spec/spec_helper.rb +103 -94
  66. data/spec/support/shared_examples_for_c_buildables.rb +68 -64
  67. data/spec/variable_array_spec.rb +12 -17
  68. data/{c → support/c}/src/cauterize.c +8 -7
  69. data/support/c/src/cauterize.h +59 -0
  70. data/{c → support/c}/src/cauterize_debug.h +0 -0
  71. data/support/c/src/cauterize_util.h +49 -0
  72. data/{c → support/c}/test/greatest.h +0 -0
  73. data/{c → support/c}/test/test.c +0 -0
  74. data/support/cs/src/CauterizeCompositeFormatter.cs +34 -0
  75. data/support/cs/src/CauterizeContainerFormatter.cs +18 -0
  76. data/support/cs/src/CauterizeEnumFormatter.cs +67 -0
  77. data/support/cs/src/CauterizeException.cs +15 -0
  78. data/support/cs/src/CauterizeFixedArrayFormatter.cs +39 -0
  79. data/support/cs/src/CauterizeFormatter.cs +40 -0
  80. data/support/cs/src/CauterizeGroupFormatter.cs +46 -0
  81. data/support/cs/src/CauterizePrimitiveFormatter.cs +33 -0
  82. data/support/cs/src/CauterizeTypeFormatterFactory.cs +39 -0
  83. data/support/cs/src/CauterizeTypes.cs +107 -0
  84. data/support/cs/src/CauterizeVariableArrayFormatter.cs +49 -0
  85. data/support/cs/src/ICauterizeTypeFormatter.cs +12 -0
  86. data/support/cs/src/OrderAttribute.cs +50 -0
  87. data/support/cs/src/PrimitiveSupport.cs +134 -0
  88. data/support/cs/src/SerializedRepresentationAttribute.cs +24 -0
  89. data/support/cs/test/CauterizeCompositeFormatterTest.cs +59 -0
  90. data/support/cs/test/CauterizeEnumFormatterTest.cs +110 -0
  91. data/support/cs/test/CauterizeFixedArrayFormatterTest.cs +91 -0
  92. data/support/cs/test/CauterizeFormatterTest.cs +40 -0
  93. data/support/cs/test/CauterizeGroupFormatterTest.cs +147 -0
  94. data/support/cs/test/CauterizeIntegrationTest.cs +129 -0
  95. data/support/cs/test/CauterizePrimitiveFormatterTest.cs +98 -0
  96. data/support/cs/test/CauterizeTypeFormatterFactoryTest.cs +73 -0
  97. data/support/cs/test/CauterizeVariableArrayFormatterTest.cs +130 -0
  98. data/support/cs/test/OrderAttributeTest.cs +39 -0
  99. data/support/cs/test/SerializedRepresentationAttributeTest.cs +39 -0
  100. metadata +68 -10
  101. data/c/src/cauterize.h +0 -46
  102. data/c/src/cauterize_util.h +0 -7
@@ -0,0 +1,130 @@
1
+ using System;
2
+ using System.IO;
3
+ using System.Text;
4
+ using System.Collections.Generic;
5
+ using System.Linq;
6
+ using Moq;
7
+ using NUnit.Framework;
8
+ using Cauterize;
9
+
10
+ namespace Cauterize.Test
11
+ {
12
+ class TestVariableArray : CauterizeVariableArrayTyped<int>
13
+ {
14
+ public static Type SizeType = typeof (Byte);
15
+
16
+ public TestVariableArray(int size)
17
+ {
18
+ Allocate(size);
19
+ }
20
+
21
+ public TestVariableArray(int[] data)
22
+ {
23
+ Allocate(data);
24
+ }
25
+
26
+ protected override int MaxSize
27
+ {
28
+ get { return Byte.MaxValue; }
29
+ }
30
+ }
31
+
32
+ [TestFixture]
33
+ public class CauterizeVariableArrayFormatterTest
34
+ {
35
+ [Test]
36
+ public void TestDeserialize()
37
+ {
38
+ var stream = new MemoryStream();
39
+ var factory = new Mock<CauterizeTypeFormatterFactory>();
40
+ var sf1 = new Mock<ICauterizeTypeFormatter>();
41
+ var sf2 = new Mock<ICauterizeTypeFormatter>();
42
+ factory.Setup(f => f.GetFormatter(It.IsAny<Type>())).Returns((Type t) =>
43
+ {
44
+ if (t == typeof (Byte))
45
+ {
46
+ return sf1.Object;
47
+ }
48
+ else if (t == typeof (Int32))
49
+ {
50
+ return sf2.Object;
51
+ }
52
+ else
53
+ {
54
+ return null;
55
+ }
56
+ });
57
+ sf1.Setup(sf => sf.Deserialize(stream, typeof (Byte))).Returns((Byte) 25);
58
+ var counter = 0;
59
+ sf2.Setup(sf => sf.Deserialize(stream, typeof(Int32))).Returns((Stream str, Type t) =>
60
+ {
61
+ var ret = 0;
62
+ if (counter == 4)
63
+ {
64
+ ret = 101;
65
+ }
66
+ else if (counter == 12)
67
+ {
68
+ ret = 321;
69
+ }
70
+ counter++;
71
+ return ret;
72
+ });
73
+ var formatter = new CauterizeVariableArrayFormatter(factory.Object);
74
+ var result = (TestVariableArray) formatter.Deserialize(stream, typeof (TestVariableArray));
75
+ Assert.AreEqual(0, result[0]);
76
+ Assert.AreEqual(101, result[4]);
77
+ Assert.AreEqual(321, result[12]);
78
+ Assert.AreEqual(0, result[13]);
79
+ }
80
+
81
+ [Test]
82
+ public void TestSerialize()
83
+ {
84
+ var stream = new MemoryStream();
85
+ var testObj = new TestVariableArray(4);
86
+ testObj[1] = 15;
87
+ testObj[3] = 16;
88
+ var sf1 = new Mock<ICauterizeTypeFormatter>();
89
+ var sf2 = new Mock<ICauterizeTypeFormatter>();
90
+ var factory = new Mock<CauterizeTypeFormatterFactory>();
91
+ factory.Setup(f => f.GetFormatter(It.IsAny<Type>())).Returns((Type t) =>
92
+ {
93
+ if (t == typeof(Byte))
94
+ {
95
+ return sf1.Object;
96
+ }
97
+ else if (t == typeof (Int32))
98
+ {
99
+ return sf2.Object;
100
+ }
101
+ else
102
+ {
103
+ return null;
104
+ }
105
+ });
106
+ sf1.Setup(sf => sf.Serialize(stream, (Byte)4));
107
+ var counter = 0;
108
+ sf2.Setup(sf => sf.Serialize(stream, It.IsAny<Int32>())).Callback((Stream str, object value) =>
109
+ {
110
+ if (counter == 1)
111
+ {
112
+ Assert.AreEqual(15, value);
113
+ }
114
+ else if (counter == 3)
115
+ {
116
+ Assert.AreEqual(16, value);
117
+ }
118
+ else
119
+ {
120
+ Assert.AreEqual(0, value);
121
+ }
122
+ counter++;
123
+ });
124
+ var formatter = new CauterizeVariableArrayFormatter(factory.Object);
125
+ formatter.Serialize(stream, testObj);
126
+ sf1.VerifyAll();
127
+ sf2.VerifyAll();
128
+ }
129
+ }
130
+ }
@@ -0,0 +1,39 @@
1
+ using System;
2
+ using System.Text;
3
+ using System.Collections.Generic;
4
+ using System.Linq;
5
+ using NUnit.Framework;
6
+ using Cauterize;
7
+
8
+ namespace Cauterize.Test
9
+ {
10
+ public class HasSomeAttrs
11
+ {
12
+ [Order(0)]
13
+ public int IntAttr { get; set; }
14
+
15
+ [Order(1)]
16
+ public string StringAttr { get; set; }
17
+
18
+ /* something unused for #2 */
19
+
20
+ [Order(3)]
21
+ public float FloatAttr { get; set; }
22
+ }
23
+
24
+ [TestFixture]
25
+ public class OrderAttributeTest
26
+ {
27
+ [Test]
28
+ public void TestItAllowsIterationOfAttributesInOrder()
29
+ {
30
+ var attrs = OrderAttribute.GetSortedProperties(typeof (HasSomeAttrs));
31
+ Assert.AreEqual("IntAttr", attrs.ElementAt(0).Name);
32
+ Assert.AreEqual("StringAttr", attrs.ElementAt(1).Name);
33
+ Assert.AreEqual("FloatAttr", attrs.ElementAt(2).Name);
34
+
35
+ var thirdAttr = OrderAttribute.GetPropertyByOrder(typeof (HasSomeAttrs), 3);
36
+ Assert.AreEqual("FloatAttr", thirdAttr.Name);
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,39 @@
1
+ using System;
2
+ using System.Text;
3
+ using System.Collections.Generic;
4
+ using System.Linq;
5
+ using NUnit.Framework;
6
+ using Cauterize;
7
+
8
+ namespace Cauterize.Test
9
+ {
10
+ [SerializedRepresentation(typeof(Int16))]
11
+ public enum MyEnum
12
+ {
13
+ Value1 = 1,
14
+ Value2 = 2,
15
+ Value3 = 3
16
+ }
17
+
18
+ [SerializedRepresentation(typeof(Int64))]
19
+ public enum MyEnum2
20
+ {
21
+ Value21 = 21,
22
+ Value22 = 22,
23
+ Value23 = 23
24
+ }
25
+
26
+ [TestFixture]
27
+ public class RepresentationAttributeTest
28
+ {
29
+ [Test]
30
+ public void TestItHasARetrievalRepresentationType()
31
+ {
32
+ var representationType = SerializedRepresentationAttribute.GetRepresentation(typeof (MyEnum));
33
+ Assert.That(representationType, Is.EqualTo(typeof(Int16)));
34
+
35
+ representationType = SerializedRepresentationAttribute.GetRepresentation(typeof (MyEnum2));
36
+ Assert.That(representationType, Is.EqualTo(typeof(Int64)));
37
+ }
38
+ }
39
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cauterize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre1
4
+ version: 0.0.1.pre5
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-30 00:00:00.000000000 Z
12
+ date: 2013-03-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -107,27 +107,33 @@ files:
107
107
  - README.md
108
108
  - Rakefile
109
109
  - bin/cauterize
110
- - c/src/cauterize.c
111
- - c/src/cauterize.h
112
- - c/src/cauterize_debug.h
113
- - c/src/cauterize_util.h
114
- - c/test/greatest.h
115
- - c/test/test.c
116
110
  - cauterize.gemspec
117
111
  - example/Cauterize
118
112
  - example/build.sh
119
113
  - lib/cauterize/base_type.rb
120
114
  - lib/cauterize/builders.rb
121
115
  - lib/cauterize/builders/c/buildable.rb
116
+ - lib/cauterize/builders/c/builtin.rb
122
117
  - lib/cauterize/builders/c/composite.rb
123
118
  - lib/cauterize/builders/c/enumeration.rb
124
119
  - lib/cauterize/builders/c/fixed_array.rb
125
120
  - lib/cauterize/builders/c/group.rb
126
121
  - lib/cauterize/builders/c/scalar.rb
127
122
  - lib/cauterize/builders/c/variable_array.rb
123
+ - lib/cauterize/builders/cs/buildable.rb
124
+ - lib/cauterize/builders/cs/builtin.rb
125
+ - lib/cauterize/builders/cs/composite.rb
126
+ - lib/cauterize/builders/cs/csarray.rb
127
+ - lib/cauterize/builders/cs/enumeration.rb
128
+ - lib/cauterize/builders/cs/fixed_array.rb
129
+ - lib/cauterize/builders/cs/group.rb
130
+ - lib/cauterize/builders/cs/scalar.rb
131
+ - lib/cauterize/builders/cs/variable_array.rb
132
+ - lib/cauterize/builtin.rb
128
133
  - lib/cauterize/c_builder.rb
129
134
  - lib/cauterize/cauterize.rb
130
135
  - lib/cauterize/composite.rb
136
+ - lib/cauterize/cs_builder.rb
131
137
  - lib/cauterize/enumeration.rb
132
138
  - lib/cauterize/fixed_array.rb
133
139
  - lib/cauterize/formatter.rb
@@ -138,16 +144,26 @@ files:
138
144
  - lib/cauterize/version.rb
139
145
  - spec/base_type_spec.rb
140
146
  - spec/builders/c/buildable_spec.rb
147
+ - spec/builders/c/builtin_spec.rb
141
148
  - spec/builders/c/composite_spec.rb
142
149
  - spec/builders/c/enumeration_spec.rb
143
150
  - spec/builders/c/fixed_array_spec.rb
144
151
  - spec/builders/c/group_spec.rb
145
152
  - spec/builders/c/scalar_spec.rb
146
153
  - spec/builders/c/variable_array_spec.rb
154
+ - spec/builders/cs/buildable_spec.rb
155
+ - spec/builders/cs/composite_spec.rb
156
+ - spec/builders/cs/enumeration_spec.rb
157
+ - spec/builders/cs/fixed_array_spec.rb
158
+ - spec/builders/cs/group_spec.rb
159
+ - spec/builders/cs/scalar_spec.rb
160
+ - spec/builders/cs/variable_array_spec.rb
147
161
  - spec/builders_spec.rb
162
+ - spec/builtin_spec.rb
148
163
  - spec/c_builder_spec.rb
149
164
  - spec/cauterize_spec.rb
150
165
  - spec/composite_spec.rb
166
+ - spec/cs_builder_spec.rb
151
167
  - spec/enumeration_spec.rb
152
168
  - spec/fixed_array_spec.rb
153
169
  - spec/group_spec.rb
@@ -159,6 +175,38 @@ files:
159
175
  - spec/support/shared_examples_for_stubbed_functions.rb
160
176
  - spec/test_main.c
161
177
  - spec/variable_array_spec.rb
178
+ - support/c/src/cauterize.c
179
+ - support/c/src/cauterize.h
180
+ - support/c/src/cauterize_debug.h
181
+ - support/c/src/cauterize_util.h
182
+ - support/c/test/greatest.h
183
+ - support/c/test/test.c
184
+ - support/cs/src/CauterizeCompositeFormatter.cs
185
+ - support/cs/src/CauterizeContainerFormatter.cs
186
+ - support/cs/src/CauterizeEnumFormatter.cs
187
+ - support/cs/src/CauterizeException.cs
188
+ - support/cs/src/CauterizeFixedArrayFormatter.cs
189
+ - support/cs/src/CauterizeFormatter.cs
190
+ - support/cs/src/CauterizeGroupFormatter.cs
191
+ - support/cs/src/CauterizePrimitiveFormatter.cs
192
+ - support/cs/src/CauterizeTypeFormatterFactory.cs
193
+ - support/cs/src/CauterizeTypes.cs
194
+ - support/cs/src/CauterizeVariableArrayFormatter.cs
195
+ - support/cs/src/ICauterizeTypeFormatter.cs
196
+ - support/cs/src/OrderAttribute.cs
197
+ - support/cs/src/PrimitiveSupport.cs
198
+ - support/cs/src/SerializedRepresentationAttribute.cs
199
+ - support/cs/test/CauterizeCompositeFormatterTest.cs
200
+ - support/cs/test/CauterizeEnumFormatterTest.cs
201
+ - support/cs/test/CauterizeFixedArrayFormatterTest.cs
202
+ - support/cs/test/CauterizeFormatterTest.cs
203
+ - support/cs/test/CauterizeGroupFormatterTest.cs
204
+ - support/cs/test/CauterizeIntegrationTest.cs
205
+ - support/cs/test/CauterizePrimitiveFormatterTest.cs
206
+ - support/cs/test/CauterizeTypeFormatterFactoryTest.cs
207
+ - support/cs/test/CauterizeVariableArrayFormatterTest.cs
208
+ - support/cs/test/OrderAttributeTest.cs
209
+ - support/cs/test/SerializedRepresentationAttributeTest.cs
162
210
  homepage: https://github.com/sw17ch/cauterize
163
211
  licenses: []
164
212
  post_install_message:
@@ -173,7 +221,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
173
221
  version: '0'
174
222
  segments:
175
223
  - 0
176
- hash: -3059868182157898473
224
+ hash: -69308014069678082
177
225
  required_rubygems_version: !ruby/object:Gem::Requirement
178
226
  none: false
179
227
  requirements:
@@ -182,23 +230,33 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
230
  version: 1.3.1
183
231
  requirements: []
184
232
  rubyforge_project:
185
- rubygems_version: 1.8.24
233
+ rubygems_version: 1.8.25
186
234
  signing_key:
187
235
  specification_version: 3
188
236
  summary: Tools to generate structures and mashalers suitable for static-memory environments.
189
237
  test_files:
190
238
  - spec/base_type_spec.rb
191
239
  - spec/builders/c/buildable_spec.rb
240
+ - spec/builders/c/builtin_spec.rb
192
241
  - spec/builders/c/composite_spec.rb
193
242
  - spec/builders/c/enumeration_spec.rb
194
243
  - spec/builders/c/fixed_array_spec.rb
195
244
  - spec/builders/c/group_spec.rb
196
245
  - spec/builders/c/scalar_spec.rb
197
246
  - spec/builders/c/variable_array_spec.rb
247
+ - spec/builders/cs/buildable_spec.rb
248
+ - spec/builders/cs/composite_spec.rb
249
+ - spec/builders/cs/enumeration_spec.rb
250
+ - spec/builders/cs/fixed_array_spec.rb
251
+ - spec/builders/cs/group_spec.rb
252
+ - spec/builders/cs/scalar_spec.rb
253
+ - spec/builders/cs/variable_array_spec.rb
198
254
  - spec/builders_spec.rb
255
+ - spec/builtin_spec.rb
199
256
  - spec/c_builder_spec.rb
200
257
  - spec/cauterize_spec.rb
201
258
  - spec/composite_spec.rb
259
+ - spec/cs_builder_spec.rb
202
260
  - spec/enumeration_spec.rb
203
261
  - spec/fixed_array_spec.rb
204
262
  - spec/group_spec.rb
data/c/src/cauterize.h DELETED
@@ -1,46 +0,0 @@
1
- #ifndef CAUTERIZE_H
2
- #define CAUTERIZE_H
3
-
4
- #include <stdint.h>
5
- #include <stddef.h>
6
-
7
- typedef uint32_t CAUTERIZE_STATUS_T;
8
-
9
- #define CA_OK (0)
10
- #define CA_ERR_ASSERT (1)
11
- #define CA_ERR_NOT_ENOUGH_SPACE (2)
12
- #define CA_ERR_NOT_ENOUGH_DATA (3)
13
- #define CA_ERR_INVALID_LENGTH (4)
14
- #define CA_ERR_INVALUD_TYPE_TAG (5)
15
- #define CA_ERR_GENERAL (UINT32_MAX)
16
-
17
- struct Cauterize {
18
- size_t size; // Size of the buffer in bytes
19
- size_t used; // Number of used bytes in the buffer
20
- size_t pos; // The next byte to be read
21
- uint8_t * buffer; // Buffer to hold data
22
- };
23
-
24
- CAUTERIZE_STATUS_T CauterizeInitAppend(
25
- struct Cauterize * m,
26
- uint8_t * buffer,
27
- size_t length);
28
-
29
- CAUTERIZE_STATUS_T CauterizeInitRead(
30
- struct Cauterize * m,
31
- uint8_t * buffer,
32
- size_t used);
33
-
34
- CAUTERIZE_STATUS_T CauterizeAppend(
35
- struct Cauterize * m,
36
- uint8_t * src,
37
- size_t length);
38
-
39
- CAUTERIZE_STATUS_T CauterizeRead(
40
- struct Cauterize * m,
41
- uint8_t * dst,
42
- size_t length);
43
-
44
- #define CA_MAX(a,b) ((a) > (b) ? (a) : (b))
45
-
46
- #endif /* CAUTERIZE_H */
@@ -1,7 +0,0 @@
1
- #ifndef CAUTERIZE_UTIL_H
2
- #define CAUTERIZE_UTIL_H
3
-
4
- #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
5
- #define MIN(a, b) (((a) < (b)) ? (a) : (b))
6
-
7
- #endif /* CAUTERIZE_UTIL_H */