Add sparse array data structure.
[pspp-builds.git] / src / libpspp / ChangeLog
1 2007-03-25  Ben Pfaff  <blp@gnu.org>
2
3         * automake.mk (src_libpspp_libpspp_a_SOURCES): Add
4         sparse-array.[ch].
5
6         * pool.c (pool_zalloc): New function.
7         (pool_calloc): New function.
8
9         * sparse-array.c: New file.
10
11         * sparse-array.h: New file.
12
13 Mon Mar  5 20:55:49 CET 2007 John Darrington <john@darrington.wattle.id.au>
14
15         * i18n.c: Cast second argument of iconv using ICONV_CONST
16
17 2007-02-22  Ben Pfaff  <blp@gnu.org>
18
19         * string.h: Don't include vsnprintf.h any more, because gnulib has
20         now absorbed it into string.h.
21
22 Thu Feb 22 12:25:52 CET 2007 John Darrington <john@darrington.wattle.id.au>
23
24         * syntax-gen.h syntax-gen.c: New files.
25
26 Sun Feb 18 11:21:41 2007  Ben Pfaff  <blp@gnu.org>
27
28         * alloc.h: Remove useless parentheses in #if "defined" operator.
29
30         * misc.h: Ditto.
31
32 Tue Feb  6 20:00:13 2007  Ben Pfaff  <blp@gnu.org>
33
34         * misc.h [!HAVE_ISINF] (isinf): Define only if isinf is not
35         defined as a macro, because mingw seems to have the macro without
36         the function.
37         [!HAVE_ISNAN] (isnan): Ditto, for symmetry only.
38         [!AHVE_FINITE] (finite): Ditto, for symmetry only.
39
40 Tue Feb  6 19:58:46 2007  Ben Pfaff  <blp@gnu.org>
41
42         * compiler.h (PRINTF_FORMAT): Use __printf__ instead of printf to
43         avoid problem with "#define printf libintl_printf" that libintl is
44         fond of doing.
45         (SCANF_FORMAT): Ditto, for symmetry only.
46
47 Tue Feb  6 19:47:10 2007  Ben Pfaff  <blp@gnu.org>
48
49         * float-format.h: [FPREP_IEEE754] [WORDS_BIGENDIAN] Add missing
50         comma.
51
52 Wed Jan 24 21:13:32 2007  Ben Pfaff  <blp@gnu.org>
53
54         * abt.c: New file.
55
56         * abt.h: New file.
57
58         * automake.mk: Add abt.c, abt.h to sources.
59
60 Sun Jan 14 21:44:18 2007  Ben Pfaff  <blp@gnu.org>
61
62         * automake.mk: Add deque.h to sources.
63         
64         * deque.h: New file.
65
66 Wed Jan 10 06:49:38 2007  Ben Pfaff  <blp@gnu.org>
67
68         * automake.mk: Add heap.c, heap.h to sources.
69
70         * heap.c: New file.
71
72         * heap.h: New file.
73
74 Sun Dec 10 13:54:03 2006  Ben Pfaff  <blp@gnu.org>
75
76         * str.c (ss_tokenize): Skip the first delimiter character
77         following the token.  Otherwise, changing delimiters from token to
78         token can't have a sensible effect, because we'll get the previous
79         delimiter as part of the next token.
80         (ss_match_string): New function.
81
82 Sat Dec  9 18:48:55 2006  Ben Pfaff  <blp@gnu.org>
83
84         * misc.h (macro range): Removed, as it was unused.
85
86 Sat Dec  9 07:19:01 WST 2006 John Darrington <john@darrington.wattle.id.au>
87
88         * array.c: Removed gratuitous #include
89
90 Thu Dec  7 20:33:23 WST 2006 John Darrington <john@darrington.wattle.id.au>
91
92         * getl.c getl.h : Changed signature of create function to take a 
93         string indicating the initial include path.
94
95 Sun Dec  3 11:36:10 2006  Ben Pfaff  <blp@gnu.org>
96
97         * str.h (SS_LITERAL_INITIALIZER): Cast the string literal to "char
98         *".  This normally does nothing but when GCC's -Wwrite-strings is
99         used it fixes a warning that otherwise can't be avoided.
100
101 Sun Dec  3 11:35:35 2006  Ben Pfaff  <blp@gnu.org>
102
103         * str.c (ss_alloc_substring_pool): New function.
104         (ss_alloc_uninit_pool) New function.
105
106 Sun Dec  3 11:28:06 2006  Ben Pfaff  <blp@gnu.org>
107
108         * getl.h: (enum getl_syntax) New enumeration to distinguish
109         between "batch" and "interactive" in a clearer way than a bool.
110         (struct getl_interface) Add an arg to "read" to return the
111         intended syntax mode.  Add an arg to "filter" to specify the
112         syntax mode of the line to filter.
113
114         * getl.c (do_read_line): Instead of returning the syntax type of
115         the line read based on whether the source itself is interactive,
116         return it based on whether the line itself should be treated as
117         having batch or interactive syntax.  Also, adapt interface to the
118         new interfaces of lex_init() and getl_interface.
119
120 Wed Nov 29 19:35:44 WST 2006 John Darrington <john@darrington.wattle.id.au>
121
122         * getl.c getl.h: New files. Created interface from base of 
123         language/line-buffer.[ch]
124
125         * msg-locator.c msg-locator.h: New files. Moved from
126         language/line-buffer.[ch]
127
128 Fri Nov 24 17:27:00 2006  Ben Pfaff  <blp@gnu.org>
129
130         * misc.h: (min) Removed.  All references updated to use MIN, from
131         minmax.h provided by gnulib.
132         (max) Ditto (for MAX).
133
134 Sun Nov 19 09:22:26 2006  Ben Pfaff  <blp@gnu.org>
135
136         * str.c (ss_get_long): New function.
137         (ss_compare_case) Ditto.
138         (ss_equals) Ditto.
139         (ss_equals_case) Ditto.
140
141 Tue Oct 31 19:28:19 2006  Ben Pfaff  <blp@gnu.org>
142
143         * str.h: [!HAVE_STRCHR] Drop compatibility code, because now we
144         assume a C89 compliant library.  (Gnulib makes this assumption so
145         we might as well too.)
146         [!HAVE_STRRCHR] Ditto.
147
148 Thu Oct 26 20:19:50 2006  Ben Pfaff  <blp@gnu.org>
149
150         * automake.mk: Add the new files.
151
152         * legacy-encoding.c: New file.
153
154         * legacy-encoding.h: New file.
155
156         * float-format.c: New file.
157
158         * float-format.h: New file.
159
160         * integer-format.c: New file.
161
162         * integer-format.h: New file.
163
164 Sun Oct 15 09:49:50 WST 2006 John Darrington <john@darrington.wattle.id.au>
165
166         * hash.c hash.h: Added hsh_create_pool, a hash which uses a pool
167         for its memory allocation.
168
169 Mon Jul 31 15:49:46 2006  Ben Pfaff  <blp@gnu.org>
170
171         * compiler.h: (macro CONST_FUNCTION) New macro.
172         (macro PURE_FUNCTION) New macro.
173
174 Sun Jul 16 21:07:35 2006  Ben Pfaff  <blp@gnu.org>
175
176         * message.c: (static int messages_disabled) New variable.
177         (msg_emit) Don't emit the message if messages are disabled.
178         (msg_disable) New function.
179         (msg_enable) New function.
180
181         * str.c: (free_string) New function.
182         (ds_register_pool) New function.
183         (ds_unregister_pool) New function.
184         (ds_set_length) New function.
185
186 Mon Jul 10 17:26:58 WST 2006 John Darrington <john@darrington.wattle.id.au>
187
188         * llx.c: #included compiler.h and removed explicit preprocessor cruft.
189
190 Fri Jul  7 20:01:26 2006  Ben Pfaff  <blp@gnu.org>
191
192         * automake.mk: (src_libpspp_libpspp_a_SOURCES) Add assertion.h.
193         
194         * assertion.h: New file.  Replaced usage of assert(0) and abort()
195         with NOT_REACHED() from this file throughout the source tree.
196
197         * message.c: (request_bug_report_and_abort) Revise message printed
198         to include request to include lines above the message, which
199         should include an assertion failure message in many cases.
200         (msg_assert_fail) Removed.
201
202         * message.h: (assert) Removed.
203         (request_bug_report_and_abort) Mark NO_RETURN.
204
205 Mon Jul  3 09:36:42 WST 2006 John Darrington <john@darrington.wattle.id.au>
206
207         * i18n.c: Made character conversion tolerant of failure to create the 
208         necessary iconv structs.
209
210 Sat Jul  1 15:32:54 2006  Ben Pfaff  <blp@gnu.org>
211
212         * automake.mk: (src_libpspp_libpspp_a_SOURCES) Add new files.
213
214         * ll.c: New file.
215
216         * ll.h: New file.
217
218         * llx.c: New file.
219
220         * llx.h: New file.
221
222 Sun Jun 25 22:35:28 2006  Ben Pfaff  <blp@gnu.org>
223
224         Optimize rehashing: we know that none of the entries in the hash
225         table are equal, so we need not compare them to each other during
226         rehashing.
227         
228         * hash.c: (locate_empty_entry) New function.
229         (rehash) Use locate_empty_entry() instead of
230         locate_matching_entry().
231
232 Fri Jun  9 14:03:29 2006  Ben Pfaff  <blp@gnu.org>
233
234         Reform string library.
235         
236         * str.c (ss_empty): New function.  Replaces some uses of ls_init()
237         or ls_null().
238         (ss_cstr) New function.  Replaces some uses of ls_init().
239         (ss_buffer) New function.  Replaces some uses of ls_init().
240         (ss_substr) New function.
241         (ss_head) New function.
242         (ss_tail) New function.
243         (ss_alloc_substring) New function.  Replaces use of ls_create().
244         (ss_alloc_uninit) New function.
245         (ss_dealloc) New function.  Replaces use of ls_destroy().
246         (ss_truncate) New function.
247         (ss_rtrim) New function.
248         (ss_ltrim) New function.
249         (ss_trim) New function.
250         (ss_chomp) New function.
251         (ss_separate) New function.
252         (ss_tokenize) New function.
253         (ss_advance) New function.
254         (ds_create) Renamed ds_init_cstr().  Updated all callers.
255         (ss_match_char) New function.
256         (ss_get_char) New function.
257         (ss_get_until) New function.
258         (ss_get_chars) New function.
259         (ss_is_empty) New function.
260         (ss_length) New function.  Replaces ls_length().
261         (ss_data) New function.  Replaces many uses of ls_c_str().
262         (ss_end) New function.  Replaces ls_end().
263         (ss_at) New function.
264         (ss_first) New function.
265         (ss_last) New function.
266         (ss_span) New function.
267         (ss_cspan) New function.
268         (ss_compare) New function.
269         (ss_pointer_to_position) New function.
270         (ss_xstrdup) New function.
271         (ds_init) Renamed ds_init_empty().  All callers updated.
272         (ds_init_string) New function.
273         (ds_init_substring) Changed interface to take a struct substring.
274         Updated all callers.
275         (ds_init_cstr) New function.  Replaces ds_create().  All callers
276         updated.
277         (ds_assign_substring) Changed interface to take a struct
278         substring.  Updated all callers.
279         (ds_assign_buffer) Removed.  Changed all callers to use
280         ds_assign_substring().
281         (ds_assign_c_str) Renamed ds_assign_cstr().  All callers updated.
282         (ds_ss) New function.
283         (ds_substr) New function.
284         (ds_head) New function.
285         (ds_tail) New function.
286         (ds_rtrim) New function.  Replaces ds_rtrim_spaces().  All callers
287         updated.
288         (ds_ltrim) New function.  Replaces ds_ltrim_spaces().  All callers
289         updated.
290         (ds_trim) New function.  Replaces ds_trim_spaces().  All callers
291         updated.
292         (ds_rtrim_spaces) Removed.
293         (ds_ltrim_spaces) Removed.
294         (ds_trim_spaces) Removed.
295         (ds_separate) Changed interface to use substrings.  All callers
296         updated.
297         (ds_tokenize) Changed interface to use substrings.  All callers
298         updated.
299         (ds_c_str) Renamed ds_cstr().  All callers updated.
300         (ds_span) Changed interface to use substring for SKIP_SET and
301         dropped OFS.  All callers updated.
302         (ds_cspan) Changed interface to use substring for STOP_SET and
303         dropped OFS.  All callers updated.
304         (ds_find_char) New function.
305         (ds_compare) New function.
306         (ds_pointer_to_position) New function.
307         (ds_xstrdup) New function.  Replaced all users of
308         xstrdup(ds_c_str(s)) by a call to this function.
309         (ds_gets) Renamed ds_read_line().  All callers updated.
310         (ds_get_config_line) Renamed ds_read_config_line().  All callers
311         updated.
312         (ds_puts) Renamed ds_put_cstr().  All callers updated.
313         (ds_put_substring) New function.  Replaces ds_concat().  All
314         callers updated.
315         (ds_concat) Removed.
316         (ds_append_uninit) Renamed ds_put_uninit().  All callers updated.
317         (ds_printf) Renamed ds_put_format().  All callers updated.
318         (ds_vprintf) Renamed ds_put_vformat().  All callers updated.
319         (ds_putc) Renamed ds_put_char().  All callers updated.
320         (ds_putc_multiple) Renamed ds_put_char_multiple().  All callers
321         updated.
322         (ls_create) Removed.  Replaced by ss_alloc_substring().
323         (ls_create_buffer) Removed.  Replaced by ss_alloc_substring().
324         (ls_init) Removed.  Replaced by ss_buffer().
325         (ls_shallow_copy) Removed.  Just use assignment.
326         (ls_destroy) Removed.  Replaced by ss_dealloc().
327         (ls_null) Removed.
328         (ls_null_p) Removed.
329         (ls_empty_p) Removed.  Replaced by ss_is_empty().
330         (ls_c_str) Removed.
331         (ls_end) Removed.  Replaced by ss_end().
332
333         * str.h (struct fixed_string): Renamed struct substring, updated
334         all users.
335         (CC_SPACES) New macro.
336         (CC_DIGITS) Ditto.
337         (CC_XDIGITS) Ditto.
338         (CC_LETTERS) Ditto.
339         (CC_ALNUM) Ditto.
340         (SS_EMPTY_INITIALIZER) Ditto.
341         (SS_LITERAL_INITIALIZER) Ditto.
342         (struct string) Removed string, length members.  Add substring
343         member.
344         (DS_INITIALIZER) Rename DS_EMPTY_INITIALIZER.
345
346 Tue May 30 19:45:12 WST 2006 John Darrington <john@darrington.wattle.id.au>
347
348         * i18n.c i18n.h: New files.
349
350 Tue May 16 06:50:35 2006  Ben Pfaff  <blp@gnu.org>
351
352         * automake.mk (src/libpspp/version.c): Removed groff_font_path,
353         which is no longer used.
354
355         * message.c (request_bug_report_and_abort): Don't print
356         groff_font_path, which no longer exists.
357
358         * version.h (locale_dir): Removed groff_font_path.
359
360 Sun May 14 22:06:53 2006  Ben Pfaff  <blp@gnu.org>
361
362         * str.c (spprintf): Moved definition of spprintf() here, from
363         str.h.
364
365         * str.h: (nsprintf) Removed.  Changed all users to use sprintf()
366         instead.
367         (nvsprintf) Removed.  Changed all users to use vsprintf() instead.
368
369 Sun May 14 20:52:20 2006  Ben Pfaff  <blp@gnu.org>
370
371         * str.c (ds_init): Remove `capacity' argument and just initialize
372         the string to a capacity of zero.  Updated all callers.
373
374 Tue May  9 09:56:57 2006  Ben Pfaff  <blp@gnu.org>
375
376         * va_copy.h: Removed.  Now use va_copy() provided by gnulib
377         instead.
378
379         * automake.mk: (src_libpspp_libpspp_a_SOURCES) Removed va_copy.h.
380
381 Sun May  7 18:17:32 2006  Ben Pfaff  <blp@gnu.org>
382
383         * pool.c (pool_vasprintf): New function.
384         (pool_asprintf) New function.
385
386 Sun May  7 17:09:54 2006  Ben Pfaff  <blp@gnu.org>
387
388         * compiler.h: (macro WARN_UNUSED_RESULT) New macro.
389
390 Sun May  7 14:32:25 2006  Ben Pfaff  <blp@gnu.org>
391
392         * va_copy.h: New header.
393
394         * str.c: Use header instead of inlining va_copy() macro
395         implementation.
396
397 Sun May  7 10:06:29 WST 2006 John Darrington <john@darrington.wattle.id.au>
398
399         * array.c array.h: Constness of sort.
400
401 Thu May  4 18:01:37 WST 2006 John Darrington <john@darrington.wattle.id.au>
402
403         * message.c message.h: Added functions to create and copy a msg.
404
405 Tue May  2 15:41:50 2006  Ben Pfaff  <blp@gnu.org>
406
407         * str.c (ds_append_uninit): No need to add 1 to arg passed to
408         ds_extend(), because the argument does not include space for a
409         null terminator.  Also, fix warning.
410
411 Tue Apr 25 11:07:19 2006  Ben Pfaff  <blp@gnu.org>
412
413         Finish reforming error message support.  In this phase, move
414         message.c into libpspp.
415         
416         * message.c: Move here from src/.  Also remove a few unneeded
417         headers.
418
419         * automake.mk (src_libpspp_libpspp_a_SOURCES): Add message.c. 
420
421 Tue Apr 25 10:54:44 2006  Ben Pfaff  <blp@gnu.org>
422
423         Continue reforming error message support.  In this phase, drop
424         actual message printing from core code, substituting a callback,
425         and add the callback to each UI.  Also, move verbose_msg() into
426         its own module.
427
428         * automake.mk (src_libpspp_libpspp_a_SOURCES): Added
429         verbose-msg.c, verbose-msg.h.
430
431         * verbose-msg.c: New file.
432
433         * verbose-msg.h: New file.
434
435 Mon Apr 24 17:26:47 2006  Ben Pfaff  <blp@gnu.org>
436
437         Continue reforming error message support.  In this phase, rename
438         all the message functions and types to start with "msg", except
439         for the ones that will be moving to other modules anyway.
440
441         All references to the identifiers below were updated likewise.
442         
443         * message.h: (enum file_locator) Renamed `enum msg_locator'.
444         (struct error) Renamed `struct msg'.
445         (err_assert_fail) Renamed msg_assert_fail().
446
447 Sun Apr 23 22:07:06 2006  Ben Pfaff  <blp@gnu.org>
448
449         Continue reforming error message support.  In this phase, get rid
450         of message "titles" and put the message text in `struct error'.
451         Now `struct error' encapsulates a message more properly.
452         
453         * message.h: (struct error) Remove `title' member.  Add `text'
454         member.
455         
456 Sun Apr 16 20:43:35 2006  Ben Pfaff  <blp@gnu.org>
457
458         Continue reforming error message support.  In this phase, we
459         divide the classification of messages along "category" and
460         "severity" axes.
461
462         * message.h: (enum msg_class) Named this set of enumerations.
463         (enum msg_category) New enum: MSG_GENERAL, MSG_SYNTAX, MSG_DATA.
464         (enum msg_severity) New enum: MSG_ERROR, MSG_WARNING, MSG_NOTE.
465         (msg_class_to_category) New inline function.
466         (msg_class_to_severity) New inline function.
467         (msg_class_from_category_and_severity) New inline function.
468         (struct error) Removed `class' member, added `category',
469         `severity'.  Updated all users of this struct to use the new
470         members.
471
472 Sun Apr 16 20:33:19 2006  Ben Pfaff  <blp@gnu.org>
473
474         * str.c (ds_vprintf): Don't try to write into the string if it is
475         null.
476
477 Sun Apr 16 18:52:41 2006  Ben Pfaff  <blp@gnu.org>
478
479         GNU standards require "file name" instead of "filename" in
480         documentation.  It's nice for our code to follow the convention
481         too.
482         
483         * message.h: (struct file_locator) Rename filename member to
484         file_name.  Updated all references.
485
486 Sun Apr 16 16:05:43 2006  Ben Pfaff  <blp@gnu.org>
487
488         Continue reforming error message support.  In this phase, we get
489         rid of VM() and the other msg() support for "verbosity", replacing
490         it by a new function verbose_msg().
491
492         * message.h: (enum ERR_CLASS_COUNT) Renamed ERR_CLASS_CNT.
493         (enum ERR_CLASS_MASK) Removed.
494         (enum ERR_VERBOSITY_SHIFT) Removed.
495         (enum ERR_VERBOSITY_MASK) Removed.
496         (macro VM) Removed.
497
498 Sun Apr 16 11:48:07 2006  Ben Pfaff  <blp@gnu.org>
499
500         Start reforming error message support.  In this phase, we get rid
501         of "installation errors" and change all uses of msg() in the
502         output drivers to uses of error() or error_at_line().
503
504         * message.h: Remove IE, IS enums.
505
506 Mon Apr  3 11:10:21 2006  Ben Pfaff  <blp@gnu.org>
507
508         * str.c: (ds_separate) Change interface for cleanliness and
509         consistency with ds_tokenize(), and rewrite to shorten and
510         simplify.  Updated all callers.
511         (ds_tokenize) New function.
512
513 Fri Mar 31 10:38:46 2006  Ben Pfaff  <blp@gnu.org>
514
515         Add freaderror() analogous to fwriteerror() in gnulib.
516
517         * freaderror.c: New file.
518
519         * freaderror.h: New file.
520
521 Thu Mar 30 16:15:37 2006  Ben Pfaff  <blp@gnu.org>
522
523         * str.c: (ds_create) Adjust capacity selection.
524         (ds_init) Use MAX macro for clarity.
525         (ds_create_substr) Rewrote.
526         (ds_replace) Renamed ds_assign_c_str(), reimplemented.  Changed
527         all callers to use a ds_assign_*() function.
528         (ds_init_substring) New function.
529         (ds_assign_string) New function.
530         (ds_assign_substring) New function.
531         (ds_assign_buffer) New function.
532         (ds_assign_c_str) New function.
533         (ds_truncate) Rewrote for clarity.
534         (ds_rpad) Reimplement in terms of ds_putc_multiple().
535         (ds_ltrim_spaces) Reimplement.
536         (ds_trim_spaces) New function.
537         (ds_separate) New function.
538         (ds_c_str) Make tolerant of null pointer, allowing static
539         initialization of strings.
540         (ds_find) Rename ds_span(), change interface.
541         (ds_n_find) Rename ds_cspan(), change interface.
542         (ds_at) New function.
543         (ds_first) Reimplement in terms of ds_at().
544         (remove_comment) New function.
545         (ds_get_config_line) Reimplement in terms of other functions.
546         Change type of LINE_NUMBER parameter.  Updated all callers.
547         (ds_vprintf) Modify for clarity.
548         (ds_putc) Better to be safe than sorry.
549         (ds_putc_multiple) New function.
550
551         * str.h: (struct string) Reorder members.
552         (macro DS_INITIALIZER) New macro that can be used to initialize a
553         string (as empty).
554         (ds_c_str) Remove inline version.
555
556 Tue Mar 28 13:49:11 WST 2006 John Darrington <john@darrington.wattle.id.au>
557
558         * str.[ch]: New functions ds_create_substr, ds_find, ds_n_find, 
559         ds_ltrim_spaces
560
561 Sat Mar  4 12:59:01 2006  Ben Pfaff  <blp@gnu.org>
562
563         * compiler.h: New file.
564
565 Sat Mar  4 11:55:16 2006  Ben Pfaff  <blp@gnu.org>
566
567         * str.h: Now assume that sprintf() returns the correct value.
568         Always implement spprintf as a static inline function.  Change
569         nsprintf, nvsprintf to simple macros that call sprintf, vsprintf.
570
571         * str.c: Remove spprintf, nsprintf, nvsprintf conditional
572         definitions.
573
574 Thu Mar  2 08:40:33 WST 2006 John Darrington <john@darrington.wattle.id.au>
575         
576         * Moved files from src directory