Debian Codegraph @

NEWS

raw
1 # 0.3.5 (31/07/2024)
2
3 The version 0.3.5 is a bugfix and enhancement release for the 0.3 branch.
4
5 ## Changes summary
6
7 * Added ctpl_value_take_string() to reduce memory copies, and used it
8 internally where appropriate;
9 * Fixed build with GCC 14;
10
11
12 # 0.3.4 (03/02/2015)
13
14 The version 0.3.4 is a bugfix and enhancement release for the 0.3 branch.
15
16 ## Changes summary
17
18 * Added Windows support to the command-line utility (Andrea Zagli);
19 * Added French and Italian translations;
20 * Fixed various build system issues;
21 * Added support for building for Windows with Automake;
22
23
24 # 0.3.3 (11/08/2011)
25
26 The version 0.3.3 is a bugfix release for the 0.3 branch.
27
28 ## Changes summary
29
30 * Fixed crash when indexing expressions;
31 * Fixed two possible reads of uninitialized memory;
32 * Plugged a few memory leaks;
33
34
35 # 0.3.2 (07/01/2011)
36
37 The version 0.3.2 is a bugfix and enhancement release for the 0.3 branch.
38
39 ## Changes summary
40
41 * Fixed crash comparing arrays with other types;
42 * Actually implemented array comparison;
43 * Added support for string literals in expressions;
44 * Fixed wrong reading of some numbers that led to parsing failure when the
45 addition or subtraction operators was not surrounded by blank characters.
46 This bug was introduced in version 0.3.1.
47
48
49 # 0.3.1 (13/11/2010)
50
51 The version 0.3.1 is a bugfix and enhancement release for the 0.3 branch.
52
53 ## Changes summary
54
55 * Fixed crash in addition operator when handling arrays;
56 * Improved floating-point numbers output;
57 * Added support for blanks between a symbol and its index;
58 * Added support for empty arrays in environment descriptions;
59
60 The most interesting change of this release is probably the improved output of
61 floating-points numbers. Floating point numbers always suffered from false
62 precision: for example "3.14" was wrongly rendered as "3.1400000000000001".
63 This problem should be fixed now.
64
65 ### Internal changes that you might notice
66
67 The way numbers are read has changed a little bit, now only the characters
68 that forms a fully valid number are read. This may lead to a different error
69 with some malformed templates -- even though there will still be an error, but
70 maybe at another step of the lexing process.
71
72 For example, template "{0x}" raised an error about the number lacking a
73 mantissa (0x is a valid prefix for an hexadecimal value, but lacks the actual
74 hexadecimal number), and now correctly read the number but raises an error
75 about character "x" being unexpected.
76
77
78 # 0.3 (09/10/2010)
79
80 The version 0.3 is an API and ABI break from the previous 0.2 branch.
81
82 ## Changes summary
83
84 * Heavy API cleanup;
85 * Array expressions can now be indexed;
86 * The `for` loop now iterates over an expression rather than a symbol name;
87 * CtplEnviron now uses reference counting;
88 * Improvements of CtplEnviron's memory usage;
89 * Bug fixes:
90 * ctpl_value_copy(), ctpl_value_set_string() and ctpl_value_set_array*() can
91 now take a part of itself as the value to set/copy;
92 * Fix internal handling of an error which may lead to wrong error detection;
93 * Fix wrong name of streams built from GFiles, paths and URIs;
94 * Fix dramatic slowness when a symbol gets pushed many times;
95 * Some internal refactoring.
96
97 Yes, it is the second API break since the library's birth, less than one year
98 ago. I know it and I apologize for the inconvenience.
99
100 But even if it's an API break, if you make normal usage of the library, it
101 shouldn't be too painful for you to upgrade to the new version (see below).
102 Many functions and data structures have been removed or made private, but the
103 API that was meant to be used by final users had only small changes.
104
105 I will also justify this new break, at least for you to understand the
106 original motivations for it:
107 * There was way too many symbols exposed, and a lot of them wasn't supposed to
108 be used by library's users;
109 * Exposing data structures (as well as some other internals) makes working on
110 the core harder, because any change to one of this data structure means an
111 API break.
112 Then this new break is here to -- hopefully -- ease future improvements of
113 CTPL, as well as preventing more API breaks.
114
115 ## What to change in your code
116
117 ### Token-related functions
118
119 The functions ctpl_token_free() and ctpl_token_expr_free() lost their second
120 (boolean) argument. If you passed TRUE here, simply remove that second
121 argument. Otherwise, you did strange things and you're screwed (but see the
122 next section).
123
124 ctpl_lexer_free_tree() has also been removed, use ctpl_token_free() instead
125 (the semantic is exactly the same).
126
127 ### Environments
128
129 CtplEnviron now uses reference counting. It means that you get all the good
130 of reference counting, but you also have to replace calls to
131 ctpl_environ_free() with ctpl_environ_unref(). Note that ctpl_environ_unref()
132 does not support NULL argument.
133
134 ctpl_environ_pop() has changed. It now takes a third argument to get the
135 poped value and returns a boolean (see the documentation for more details).
136 Anyway you should probably not need ctpl_environ_pop() at all.
137
138 ### Input and output streams
139
140 ctpl_input_stream_read_double() and ctpl_input_stream_read_long() are renamed
141 to ctpl_input_stream_read_float() and ctpl_input_stream_read_int() for more
142 consistency with the rest of the API.
143
144 ### Others
145
146 The environment to pass to ctpl_eval_*() is not constant anymore. This will
147 probably not change anything for you, but it's a subtle change. This is to
148 allow future operators to affect the environment if needed (which isn't the
149 case yet).
150
151 ## The dark side of the cleanup
152
153 Apart the inconvenience of an API break, some "features" of the library may be
154 gone -- yes, having many internal exposed may allow unwanted "features".
155 First, know that these features weren't planned. Then, feel free to contact
156 me, explaining what functionality you miss and why, and I'll probably be happy
157 to re-introduce it cleanly for you.
158
159 ## CLI tool changes
160
161 The CLI tool, apart then new features of the template engine, gained support
162 for encodings. This brings a new `--encoding` option allowing to specify the
163 encoding of the input and output files. The default encoding is the system's
164 one.
165
166
167 # 0.2.2 (25/05/2010)
168
169 The version 0.2.2 is a bugfix release for the 0.2 branch.
170
171 ## Changes summary
172
173 * Fix lexing of a whole expression input (using ctpl_lexer_expr_lex() or
174 one of its variants);
175 * Fix priority of boolean operators AND and OR;
176 * Fix support of operators <= and >=;
177 * Better error reporting in the expression lexer;
178 * New alternative build system: Waf (from a work by Enrico Tröger, thanks).
179
180
181 # 0.2.1 (27/04/2010)
182
183 The version 0.2.1 is a bugfix release for the 0.2 branch.
184
185 ## Changes summary
186
187 * Do not export the private API;
188 * Little cleaning of the build system.
189
190
191 # 0.2 (15/04/2010)
192
193 The version 0.2 is an API and ABI break from the previous 0.1 branch.
194
195 ## Changes summary (in-depth):
196
197 ### New features and important changes
198
199 * GIO replaces LibMB. Impact is:
200 * Less memory usage (input template may or may not be loaded into memory);
201 * Small performance regression, between 8% to 19% [1] (on extreme cases),
202 measured on heavy templates;
203 * Any GIO stream may be live-lexed, from local files to remote FTP, Samba,
204 DAV, etc.
205 * Better lexer error reporting, with line and position marks;
206 * Improved numeric constants loading, including:
207 * Integers are now loaded as integers, impacting:
208 * No more precision loss;
209 * Shorter maximum value, but still more than reasonable (C's long: in 64
210 bits machines should be something like from -9223372036854775807 to
211 +9223372036854775807, and -2147483647 to +2147483647 on 32 bits
212 machines).
213 * Support for octal and binary constants via 0o and 0b prefix respectively;
214 * Improved token representation, saving about from 19% to 28% of memory use
215 for the token tree (no measurable performance impact) (already in 0.1.90);
216 * Add support for single-line comments in environ descriptions;
217 * Fix support of array values that starts with blanks in environ descriptions;
218 * `make distcheck` and out-of-tree build now work;
219 * Add man page for the ctpl command-line utility.
220
221 As you can see, the main improvements of this release are less memory
222 consumption (about 30/40% better!) and GIO usage bringing almost universal
223 input.
224
225 ## Quid of the performances?
226
227 Yes, we lost about 8% to 19% [1] of speed. But I decided that the gain worth
228 it: GIO allows live streams to be parsed without loading them previously into
229 memory, which means that the memory usage is about the same minus about the
230 size of the input template.
231 Since the parsing of a 140M (28366227 lines) example template took 15.9612s
232 before and 17.4756s now (8.67% slower), I thought it was reasonable when we
233 gained about 140M of memory. Another test (135M input, 10944000 lines) took
234 11.4204s before and 13.3378s now (14.38% slower), but needed about 130M less
235 memory.
236
237 And still note that these are very heavy templates (yes, 11-28.4M lines!), and
238 real world templates are really really smaller. And this is the lexing, which
239 is done only once per template, the parsing is not impacted.
240
241 Finally, note that invalid templates may be found invalid without reading the
242 whole input, especially if the invalid data is at the start. This makes for
243 example a 350M invalid template to be immediately (huh, about 0.009s, and this
244 includes program launching) reported as invalid, and this about 99% faster
245 than before (without any I/O latency).
246
247 [1] note that the measurement was done with all the changes (except token tree
248 optimization), which can mean that the overhead is not only due to GIO but
249 to the new features too.
250 Another thing to note is that this measurement always used a cached file
251 input, meaning that any I/O gain or loss due not to load the whole
252 template at once was not took into account; but I/O doesn't make so much
253 sense since it depends heavily on the input location (even two hard drives
254 might behave quite differently, depending on their speed, cache size and
255 so on). But with I/O, results moves from +18.66% to -3.59% slower.
256
257
258 # 0.1.90 (06/04/2010)
259
260 The version 0.1.90 is the last of the 0.1.x branch. It is the 0.2-minus-one
261 release, with a part of the 0.1-compatible improvements that will come in the
262 upcoming 0.2 branch.
263
264 ## Changes summary
265
266 * Improved token representation, saving about from 20% to 30% of memory use
267 for the token tree (no measurable performance impact);
268 * New ctpl_environ_foreach() and ctpl_environ_merge() functions;
269 * Fix missing inclusion of readutils.h in the global header.
270
271
272 # 0.1.1 (15/03/2010)
273
274 The version 0.1.1 is a bugfix release for the 0.1 branch.
275
276 ## Changes summary
277
278 * Fixed stack overflow with very large token trees;
279 * Great speed improvement with large token trees.
280
281
282 # 0.1 (30/11/2009)
283
284 The version 0.1 is the first release of CTPL. CTPL is a template engine
285 library aiming to easily allow template parsing from C programs.