Use mpdm_string() instead of v->data in regex1().
[mpdm.git] / TODO
blob70d0fa695e68c8dbaf8f27a2c53a34bcaa98f67c
1 Minimum Profit Data Manager (MPDM) TODO / Bug List
2 ==================================================
4 Release Critical Bugs
5 ---------------------
7  * 1121: Document MPDM_LA().
9 Open Bugs
10 ---------
12  * 1056: Finish the overview document.
13  * 1103: mpdm_home_dir() calls strcat() insecurely.
14  * 1104: mpdm_app_dir() calls strcat() insecurely.
16 Pending Enhancements
17 --------------------
19  * 1008: bread().
20  * 1009: bwrite().
21  * 1063: Implement copy-on-write on array cloning.
22  * 1101: Move mpdm_sym(), mpdm_sget() and mpdm_sset() to MPSL, as they
23    don't really belong here.
24  * 1122: Modify MPDM_I() and MPDM_R() to move the sprintf()-ing of
25    the value to mpdm_string(). This will delay numbers' printable
26    representation until (or if) really needed.
28 Closed
29 ------
31  * 1000: All string operations should use wchar_t instead of char
32    (Closed by: #1001; Sat, 3 Jul 2004 11:14:00 +0200).
33  * 1001: Merge mpdm-branch-wchar
34    (Closes: #1000; Sun, 4 Jul 2004 11:06:00 +0200).
35  * 1002: mpdm_aget() and mpdm_aset() should accept negative offsets
36    (Mon, 12 Jul 2004 17:44:00 +0200).
37  * 1012: mpdm_startup() and mpdm_shutdown() (Thu, 26 Aug 2004 20:10:02 +0200)
38  * 1013: Move the hardwired '16' number of minimum elements to an
39    struct _mpdm element, set from mpdm_startup()
40    (Thu, 26 Aug 2004 20:10:18 +0200).
41  * 1014: Create a new high threshold for values, to force calling
42    mpdm_sweep() from mpdm_new() if that threshold is overpassed (this
43    will allow a limit to be imposed to the number of unreferenced
44    values) (Thu, 26 Aug 2004 20:26:21 +0200).
45  * 1019: Rework mpdm_dump() to avoid using dynamic values
46    (Wed, 08 Sep 2004 21:52:39 +0200).
47  * 1020: Set errno on errors (Discarded; Thu, 07 Oct 2004 17:11:52 +0200).
48  * 1003: Beyond ties; suppress all flags (except some internal ones as IVAL
49    or EXEC). Everything should be done with ties; for example, there
50    should exist a _CMP tie function that would be executed when two
51    values being compared have the same tie (or, better, the same _CMP
52    function). Specially, MPDM_STRING and MPDM_MULTIPLE should disappear.
53    A value will be assumed multiple when having a tie function _AEXPAND
54    (or _AGET, or so). Code will become incidentally clean (no more "if
55    flags & MPDM_" scattered through the code). Risky change!
56    (Discarded; Wed, 08 Dec 2004 09:48:27 +0100).
57  * 1005: Should ties be in a special source file, mpdm_t.c ?
58    (Discarded; Wed, 08 Dec 2004 09:49:06 +0100).
59  * 1011: Will the scripting language be included here, or as a
60    separated package? it could poison the mpdm concept as a 'low
61    level utility library' (Yes; Wed, 08 Dec 2004 09:51:55 +0100).
62  * 1010: Find a name for the scripting language (Mpsl should be
63    fine; Wed, 08 Dec 2004 09:52:32 +0100).
64  * 1026: Make the _mpdm control structure public
65    (Wed, 08 Dec 2004 11:34:54 +0100).
66  * 1025: Change non-dyn values. They should be stored in a pool of
67    values, and 'allocated' from within mpdm_new(). Two macros, for
68    instance MPDM_ND_BEGIN() and MPDM_ND_END(), could save
69    / restore a static index to that pool. Instead, the allocation
70    from the pool would just wrap (Wed, 08 Dec 2004 16:52:21 +0100).
71  * 1030: non-dyn array values are completely broken; the creation
72    should include the array of values and not take it from mpdm_alloc().
73    (Wed, 08 Dec 2004 19:16:05 +0100).
74  * 1031: Size in MPDM_ND_A() is superfluous, as it can be calculated
75    (Wed, 08 Dec 2004 22:12:57 +0100).
76  * 1033: Create a new mpdm_hexists() function
77    (Thu, 09 Dec 2004 11:19:03 +0100).
78  * 1037: Add caching support in values for real numbers (like ival).
79    (Sun, 12 Dec 2004 17:54:34 +0100).
80  * 1043: Change mpdm_write() so that it doesn't use printf(), but
81    wcstombs() and an small local buffer (Mon, 20 Dec 2004 08:41:20 -0800).
82  * 1045: mpdm_dump() should not use printf() for mpdm_string(), but
83    convert by hand using wcstombs() (Mon, 20 Dec 2004 08:44:52 -0800).
84  * 1044: mpdm_write() should include a 3rd argument, a separator
85    for the end of line (Mon, 20 Dec 2004 08:54:39 -0800).
86  * 1048: mpdm_rval() breaks locales (Wed, 05 Jan 2005 16:05:52 +0100).
87  * 1047: Change _mpdm_sym() to force the creation of all intermediate
88    arrays or hashes in the way. Also, it does not make much sense to
89    be in plain mpdm; it should be part of mpsl (Discarded;
90    Sat, 08 Jan 2005 21:30:55 +0100).
91  * 1016: Add optional iconv support
92    (Closed by #1055; Thu, 10 Mar 2005 13:26:54 +0100).
93  * 1054: Add a main() function, similar to the filp one
94    (Not applicable; Fri, 18 Mar 2005 06:46:06 +0100).
95  * 1032: Nondyn arrays must be protected in mpdm_aexpand(),
96    mpdm_acollapse(), etc (Fri, 18 Mar 2005 08:00:28 +0100).
97  * 1004: Create a tie function for mpdm_dump()
98    (No; Fri, 18 Mar 2005 08:04:19 +0100).
99  * 1057: Iconv objects can't be reused for different files, so
100    current implementation is faulty. Each iconv_t variable should
101    be stored inside the file value (Fri, 25 Mar 2005 02:24:10 +0100).
102  * 1055: Iconv support works, but is nearly useless; iconverters
103    should be associated to file descriptors, which are the only
104    place where iconv will really be used (Fri, 25 Mar 2005 03:04:26 +0100).
105  * 1058: Changeset on "2005-03-25 02:26 CET" (file descriptors in their's
106    own structure) broke mpsl (SIGSEGV's on compiling from file). Last
107    working version was "cvs update -D '2005/03/25 02:26'"
108    (Bug is in mpsl; Fri, 25 Mar 2005 12:17:21 +0100).
109  * 1015: The auto-sweep introduced by _mpdm.high_threshold is
110    extremely unsafe. At least, internal parts of mpdm should be
111    autosweep-safe (high_threshold abandoned; Mon, 28 Mar 2005 16:40:38 +0200).
112  * 1059: Get rid of ties. They are flexible and sexy, but add a complexity
113    that isn't worth (Sun, 03 Apr 2005 16:38:44 +0200).
114  * 1018: Support for optional features (like gdbm) should be stored
115    in an mpdm array or hash to easily ask for capabilities (gdbm support
116    dropped, and no other optional features; Sun, 03 Apr 2005 16:39:19 +0200).
117  * 1027: Store all static _tie... values in ties in the main
118    control structure (ties no longer exist; Sun, 03 Apr 2005 16:40:12 +0200).
119  * 1029: Store the regex cache in the main control structure
120    (Sun, 03 Apr 2005 16:40:32 +0200).
121  * 1028: With the closing of bugs #1026, #1027 and #1029, it should be
122    easy to have multiple mpdm engines, just by commuting the _mpdm
123    pointer. So, there should exist an mpdm_cleanup() function,
124    that would, after destroying values by calling mpdm_shutdown(),
125    free the rest of values stored inside. This kind of cleanup should
126    not be necessary on normal shutdown, as memory will be freed by
127    the operating system anyway (Doesn't seem necessary nor useful;
128    Mon, 04 Apr 2005 18:51:48 +0200).
129  * 1062: sprintf() (Not applicable, it should be implemented on mpsl instead;
130    Mon, 11 Apr 2005 17:52:38 +0200).
131  * 1060: Some old Unix systems (for example, IRIX) and mingw32
132    don't have the mbrtowc() function (they do have mbtowc(), though)
133    (Tue, 12 Apr 2005 18:55:42 +0200).
134  * 1017: Add optional gettext support (Sat, 16 Apr 2005 11:05:31 +0200).
135  * 1064: There should exist some way to detect the lack of gettext
136    support and set a translation hash (Closed by #1065;
137    Sat, 16 Apr 2005 11:32:11 +0200).
138  * 1071: The _cache_18n hash in mpdm_s.c has be moved to the main control
139    structure (Thu, 26 May 2005 14:01:17 +0200).
140  * 1072: mpdm_v should be renamed to mpdm_t (Thu, 26 May 2005 17:34:27 +0200).
141  * 1067: Get rid of symbols prefixed with _ (Thu, 26 May 2005 17:59:17 +0200).
142  * 1068: Rewrite the circular list of values as a double-list (i.e., with
143    links to previous) (Thu, 26 May 2005 18:48:56 +0200).
144  * 1069: The mpdm_free() function should dequeue the value about to be
145    destroyed; this way, it could be called from other functions, like
146    mpdm_unref() (Thu, 26 May 2005 18:48:56 +0200).
147  * 1070: Modify mpdm_unref() to optionally destroy a value when its
148    reference count gets to 0 (needs #1068 and #1069 closed) (No. This is not
149    that a good idea, as there are many places where values are referenced to
150    zero and later used, as in mpdm_asort(), or where semantics change, for
151    example, when mpdm_aset() returns the previous value;
152    Thu, 26 May 2005 20:28:33 +0200).
153  * 1073: Add a wcwidth() implementation for systems lacking it (for
154    example, mingw32) (Mon, 11 Jul 2005 07:55:31 +0200).
155  * 1074: Add multiline regex strings (Mon, 11 Jul 2005 15:57:06 +0200).
156  * 1076: If the string to be matched cannot be converted to mbs, both
157    mpdm_regex() and mpdm_sregex() abort (Sat, 22 Oct 2005 13:59:12 +0200).
158  * 1077: mpdm_mbstowcs() should return "" instead of NULL when converting
159    an empty string (Sat, 22 Oct 2005 18:00:50 +0200).
160  * 1075: mpdm_regex() is broken in UTF-8 environments,
161    as it's assuming that the matching information returned by regexec()
162    (in byte count) can be directly used as wchar_t offsets
163    (Sat, 22 Oct 2005 18:12:20 +0200).
164  * 1078: mpdm_sregex() is broken in UTF-8 environments,
165    as it's assuming that the matching information returned by regexec()
166    (in byte count) can be directly used as wchar_t offsets
167    (Sat, 22 Oct 2005 22:50:51 +0200).
168  * 1079: Previous match information for regexes contain wrong
169    values if the string to be matched is multibyte
170    (Sun, 23 Oct 2005 21:21:43 +0200).
171  * 1080: Related to #1079, multiline regexes don't work in
172    multibyte locales, as it's also relying on rm containing
173    offsets in characters (Sun, 23 Oct 2005 21:35:08 +0200).
174  * 1081: Document all the MPDM_ macros (Tue, 22 Nov 2005 17:03:40 +0100).
175  * 1082: Add categories to mp_doccer documentation
176    (Tue, 22 Nov 2005 17:03:45 +0100).
177  * 1065: There should exist some way to detect lack of gettext support
178    in runtime to add implementation-specific workarounds as, for
179    example, filling the i18n cache manually. This is something like
180    a reopening of bug #1018 (Implemented by returning failure from
181    mpdm_gettext_domain(); Thu, 19 Jan 2006 08:15:21 +0100).
182  * 1084: As mpdm_sregex() now executes code, all values should be
183    referenced to avoid undesired sweeps (Mon, 13 Feb 2006 09:12:41 +0100).
184  * 1083: Add pipe support (Tue, 09 May 2006 18:02:19 +0200).
185  * 1087: Add pipe support for win32 (Fri, 12 May 2006 08:04:30 +0200).
186  * 1086: Add a way to get the 'library' (/usr/PREFIX/share on Unix
187    and the "Program Files" directory on Windows) and 'home' (~ and
188    "My Documents") directories (Fri, 12 May 2006 13:26:32 +0200).
189  * 1088: mpdm_sprintf() (Tue, 23 May 2006 18:07:58 +0200).
190  * 1091: Change CONFOPT_NULL_HASH to a runtime switch using an
191    environment variable (Wed, 13 Sep 2006 16:07:18 +0200).
192  * 1006: stat() (Tue, 10 Oct 2006 13:00:54 +0200).
193  * 1007: chmod() (Tue, 10 Oct 2006 13:00:54 +0200).
194  * 1089: Change mpdm_cmp() to use wcscoll() instead of wcscmp()
195    (Tue, 10 Oct 2006 13:54:36 +0200).
196  * 1092: fseek() (Thu, 12 Oct 2006 09:54:34 +0200).
197  * 1093: ftell() (Thu, 12 Oct 2006 09:54:34 +0200).
198  * 1090: Sort the array in mpdm_glob() to show directories first
199    (Fri, 10 Nov 2006 17:32:27 +0100).
200  * 1095: The %c directive in sprintf() should work with Unicode
201    (or wchar_t) characters (Mon, 11 Jun 2007 08:42:02 +0200).
202  * 1096: On mpdm_sregex(), substitute all unescaped & with the regex match
203    (Mon, 18 Jun 2007 12:23:37 +0200).
204  * 1097: Fixed a bug in offset processing in mpdm_sregex()
205    (Mon, 18 Jun 2007 13:54:24 +0200).
206  * 1098: mpdm_cmp(NULL, NULL) should return 0
207    (Wed, 12 Sep 2007 09:50:08 +0200).
208  * 1100: Allow for a component in a 'symbol' managed by mpdm_sym() to
209    be an executable (Tue, 25 Sep 2007 18:13:38 +0200).
210  * 1099: mpdm_cmp() should be optimized to return 0 if two arrays
211    are *the same* (Closed by 1102; Fri, 28 Sep 2007 13:01:55 +0200).
212  * 1102: Optimize mpdm_cmp() when comparing the same values
213    (Fri, 28 Sep 2007 13:10:44 +0200).
214  * 1107: Implement functions to set the ival and rval of a value
215    (Thu, 29 Nov 2007 09:07:33 +0100).
216  * 1106: Implement a function to get the file handle of an MPDM_FILE type
217    (Thu, 29 Nov 2007 13:12:48 +0100).
218  * 1085: Use const wherever possible (Fri, 18 Jan 2008 14:10:12 +0100).
219  * 1108: Fix the %% usage in mpdm_sprintf()
220    (Sun, 30 Mar 2008 17:41:02 +0200).
221  * 1061: On IRIX, iconv() doesn't have the "WCHAR_T" charset, so
222    iconv support doesn't seem to work there; but it has "UCS-4", which
223    is practically the same and it works, so there should be some
224    workaround to use it whenever "WCHAR_T" fails
225    (Mon, 07 Apr 2008 14:55:30 +0200).
226  * 1109: expand_ampersands() kills all backslashes
227    (Tue, 03 Feb 2009 07:25:21 +0100).
228  * 1110: Win32 file globbing fails when a leading directory is specified
229    (Wed, 25 Mar 2009 17:04:29 +0100).
230  * 1111: Document mpdm_sscanf() (Wed, 26 Aug 2009 09:07:01 +0200).
231  * 1112: Document the `DETECTED_ENCODING' variable
232    (Wed, 26 Aug 2009 09:40:03 +0200).
233  * 1113: Document the `TEMP_ENCODING' variable
234    (Wed, 26 Aug 2009 09:40:03 +0200).
235  * 1114: Fixed mpdm_sset() when the previous-to-last value to be
236    assigned is executable (Tue, 22 Dec 2009 10:05:12 +0100).
237  * 1066: Implement a minimum time-to-live for values; never referenced values
238    younger than that will never be swept. Values under explicit [un]ref()
239    control won't have this, as they (should) never be used after being
240    unreferenced, so TTL will be unset after being unreferenced to 0. Anyway,
241    as this could mask possible sweeping errors, it has not been implemented yet
242    (no longer applicable; Fri, 14 Jan 2011 12:31:28 +0100).
243  * 1094: Try an (optional) usage of pthreads to call sweep() in a low priority
244    thread, when nothing else is happening (no longer applicable;
245    Fri, 14 Jan 2011 12:31:28 +0100).
246  * 1105: Try another approach: store in the circular queue only the
247    unreferenced values; the others will be completely unqueued. This way,
248    values to be swept are immediately found. On the other side, mpdm_ref()
249    and mpdm_unref() will be much expensive, as they will en/dequeue values
250    depending of v->ref 0 or 1 (no longer applicable; Fri, 14 Jan 2011 12:31:28 +0100).
251  * 1120: Drop completely the garbage collection and convert it to a pure
252    reference-counting system (Fri, 14 Jan 2011 12:30:30 +0100).
253  * 1115: Invert mpdm_split() arguments (Thu, 03 Feb 2011 09:25:38 +0100).
254  * 1116: Invert mpdm_join() arguments (Thu, 03 Feb 2011 09:42:48 +0100).
255  * 1117: Invert mpdm_sscanf() arguments (Thu, 03 Feb 2011 10:08:28 +0100).
256  * 1119: Invert mpdm_sregex() arguments (Thu, 03 Feb 2011 13:10:49 +0100).
257  * 1118: Invert mpdm_regex() arguments (Thu, 03 Feb 2011 16:01:50 +0100).
259 Email bugs to angel@triptico.com