* add xdgmime from freedesktop.org
[citadel.git] / libcitadel / lib / xdgmime / ChangeLog
1 2007-08-28  Bastien Nocera  <hadess@hadess.net>
2
3         * src/.cvsignore:
4         * src/Makefile:
5         * src/test-mime-data.c: Add test-mime-data test program from
6         Matthias Clasen <mclasen@redhat.com> (Closes: #5210)
7
8 2007-06-04  Christian Neumair  <cneumair@gnome.org>
9
10         * src/xdgmime*.[ch]: Rename _caches to _xdg_mime_caches. Also
11         namespace all reserved symbols that are declared in headers using
12         XDG_RESERVED_ENTRY(), #7074 and #11124. Thanks to Yevgen Muntyan
13         <muntyan@tamu.edu> and Joe Marcus Clarke <marcus@freebsd.org>.
14
15 2007-06-02  Christian Neumair  <cneumair@gnome.org>
16
17         * src/xdgmime.[ch]: Move xdg_mime_type_unknown to .rodata.
18         * src/xdgmime.h: Add XDG_ENTRY() entry for xdg_mime_dump.
19         GTK+ resync.
20
21         * src/xdgmime.c: (_xdg_mime_alias_list_lookup): Initialize mime_type
22         to NULL instead of 0, GNOME #341812. Thanks to Kjartan Maraas
23         <kmaraas@gnome.org>.
24
25         * src/xdgmime.[ch]: (xdg_mime_media_type_equal),
26         (_xdg_mime_media_type_equal): Add private version of
27         xdg_mime_media_type_equal that doesn't call xdg_mime_init(), use it in
28         _xdg_mime_mime_type_subclass.
29
30 2007-06-02  Christian Neumair  <cneumair@gnome.org>
31
32         * src/xdgmimemagic.c: Fallback to getc() if getc_unlocked() is not
33         available, GNOME #381499. Thanks to Paul <ephraim_owns@hotmail.com>.
34
35 2007-06-01  Christian Neumair  <cneumair@gnome.org>
36
37         * src/xdgmime.c: (xdg_mime_get_mime_type_for_file): Only request two
38         MIME types from cache.
39
40         * src/xdgmime.c: (xdg_mime_dump): Dump cache.
41
42         * src/xdgmimecache.c: Warn if building without MMAP support.
43
44 2007-06-01  Christian Neumair  <cneumair@gnome.org>
45
46         * src/xdgmime.c: (xdg_lookup_cache_for_file), (xdg_check_dir):
47         Fix constant re-creation of memory MIME cache, #7495.
48
49 2007-06-01  Christian Neumair  <cneumair@gnome.org>
50
51         * src/xdgmimeglob.c: (_xdg_glob_hash_node_lookup_file_name): Don't
52         return NULL MIME types, #5241.
53
54 2007-06-01  Christian Neumair  <cneumair@gnome.org>
55
56         * src/xdgmime.c: (xdg_mime_shutdown): Fix cache variable name from last
57         commit.
58
59         * src/xdgmime.c: (xdg_mime_unalias_mime_type), (xdg_mime_mime_type_equal):
60         * src/xdgmime.h:
61         * src/xdgmimemagic.c: (_xdg_mime_magic_lookup_data):
62         Define and use private versions of functions that may lead to an
63         xdg_mime_init() call and thus to an invalid cache, and a crash - #6824.
64         Thanks to Joe Shaw <joeshaw@novell.com>.
65
66 2007-06-01  Christian Neumair  <cneumair@gnome.org>
67
68         * src/xdgmime.c: (xdg_mime_shutdown): Free caches, #7496.
69         Thanks to Yevgen Muntyan <muntyan@tamu.edu>.
70
71 2007-06-01  Christian Neumair  <cneumair@gnome.org>
72
73         * src/xdgmimecache.c: (cache_glob_node_lookup_suffix): Don't return
74         MIME types if cache suffix lookup returns empty string, #9544.
75         Thanks to Yevgen Muntyan <muntyan@tamu.edu>.
76
77 2007-06-01  Christian Neumair  <cneumair@gnome.org>
78
79         * src/xdgmimemagic.c: (_xdg_mime_magic_lookup_data): Fix issue where
80         MIME type was not detected when two MIME types with parent
81         relationship match and have equal priority, and child
82         was found before parent in cache, #9242.
83         Thanks to Tom Parker <freedesktop@tevp.net>.
84
85 2007-06-01  Christian Neumair  <cneumair@gnome.org>
86
87         * src/xdgmimecache.c: (_xdg_mime_cache_list_mime_parents): Fix
88         several problems with this function, #9560. Thanks to Yevgen Muntyan.
89
90 2007-06-01  Christian Neumair  <cneumair@gnome.org>
91
92         * src/xdgmimemagic.c: Don't declare errno, fixes build on Dragonfly
93         BSD, GNOME #336382.
94
95 2006-07-13  Christian Neumair  <chris@gnome-de.org>
96
97         * src/xdgmimemagic.c: (_xdg_mime_magic_parse_magic_line):
98         Only declare 'i' #if LITTLE_ENDIAN. Partially fixes GNOME #340277.
99         Thanks to James Andrewartha.
100
101 2006-03-02  Christian Neumair  <chris@gnome-de.org>
102
103         * src/xdgmimeglob.c: (_xdg_glob_hash_insert_text),
104         (_xdg_glob_hash_append_glob): Don't strdup the MIME type when passing
105         it to _xdg_glob_hash_insert_text, but let the function itself figure
106         out whether string duplication is needed. Fixes #5993.
107         Thanks to Martin Wehner.
108
109 2006-02-25  Christian Neumair  <chris@gnome-de.org>
110
111         * src/xdgmimemagic.c: (_xdg_mime_magic_lookup_data): Make
112         priority equality check more robust so that it works for three or more
113         matches. Also allow matchlets with 0 priority.
114
115 2006-02-19  Christian Neumair  <chris@gnome-de.org>
116
117         * src/xdgmimemagic.c: (_xdg_mime_magic_lookup_data): When two
118         unrelated MIME types with equal priorities match, don't assume one of
119         them matches.
120         http://bugzilla.gnome.org/show_bug.cgi?id=331719
121
122 2006-01-03  Christian Neumair  <chris@gnome-de.org>
123
124         * src/xdgmimemagic.c: (_xdg_mime_magic_lookup_data): Also consider
125         match priority for the returned MIME type.
126
127 2005-12-01  Christian Neumair  <chris@gnome-de.org>
128
129         * src/xdgmime.c: (xdg_mime_get_mime_type_from_file_name):
130         * src/xdgmimecache.c: (_xdg_mime_cache_get_mime_type_from_file_name):
131         Return XDG_MIME_TYPE_UNKNOWN if multiple MIME types match a simple
132         pattern.
133
134 2005-12-01  Matthias Clasen  <mclasen@redhat.com>
135
136         * src/xdgmimecache.h:
137         * src/xdgmimecache.c (_xdg_mime_cache_get_mime_type_for_file): 
138         Allow passing in a struct stat * to avoid re-stat()ing. 
139         Forgotten commit from an earlier entry.
140
141         * src/xdgmimecache.c (cache_glob_lookup_literal):
142         (cache_glob_lookup_fnmatch):
143         (cache_glob_node_lookup_suffix): Change these functions to
144         allow returning more than one mime type if identical globs
145         match.
146
147         * src/xdgmimemagic.h: 
148         * src/xdgmimeglob.h: 
149         * src/xdgmimemagic.c (_xdg_mime_magic_lookup_data): 
150         * src/xdgmimeglob.c (_xdg_glob_hash_lookup_file_name): 
151         Change these functions to allow returning more than one
152         mime type if identical globs match.
153         
154         * src/xdgmimecache.c (_xdg_mime_cache_get_mime_type_for_file): 
155         * src/xdgmime.c (xdg_mime_get_mime_type_for_file): 
156         If multiple identical globs match, use magic to disambiguate.
157         
158 2005-11-04  Matthias Clasen  <mclasen@redhat.com>
159
160         * xdgmime.c (xdg_mime_list_mime_parents): Prevent
161         a segfault.
162
163 2005-10-18  Matthias Clasen  <mclasen@redhat.com>
164         
165         * src/xdgmime.c:
166         * src/xdgmimecache.h:
167         * src/xdgmimecache.c: Make the array of caches NULL-terminated
168         and rename it to _caches.  (#4011)
169
170         * src/xdgmime.h:
171         * src/xdgmime.c: Add a struct statbuf * argument to 
172         xdg_mime_get_mime_type_for_file().  (#3529)
173
174         * src/test-mime.c: Adjust callers. Add License.
175
176         * src/xdgmimecache.c: Make magic comparisons work correctly.
177
178 Thu Jun  9 23:55:25 2005  Jonathan Blandford  <jrb@redhat.com>
179
180         * src/xdgmime.c (xdg_mime_init_from_directory): patch from
181         federico to realloc the right size, #3506
182
183 2005-04-17  Christophe Fergeau  <teuf@gnome.org>
184
185         * src/xdgmimeint.c: fix gcc4 signedness warning
186
187 2005-04-17  Christophe Fergeau  <teuf@gnome.org>
188
189         * src/xdgmimemagic.c: (_xdg_mime_magic_matchlet_compare_to_data),
190         (_xdg_mime_magic_matchlet_compare_level),
191         (_xdg_mime_magic_lookup_data): when  magic patterns matches, check if
192         there aren't subtypes with matching patterns too, and if so, favour
193         the subtype over the parent type, should fix #2686
194
195 2005-04-16  Christophe Fergeau  <teuf@gnome.org>
196
197         * src/xdgmime.c: (xdg_mime_init_from_directory): fix leak when
198         mime.cache doesn't exist
199
200 2005-04-16  Christophe Fergeau  <teuf@gnome.org>
201
202         * src/test-mime.c: (main): disabled call to xdg_mime_dump for now
203         * src/xdgmimemagic.c: (_xdg_mime_magic_matchlet_compare_to_data):
204         fixed off by 1 error when handling offsets, fixes bug #2050 and 
205         partly bug #2359
206
207 Fri Apr  8 23:37:33 2005  Jonathan Blandford  <jrb@redhat.com>
208
209         * src/xdgmimecache.c: Actually add the file.  Also, patch from
210         Matthias Clasen <mclasen@redhat.com> to fix small bugs, #2939
211
212 Fri Apr  1 14:59:43 2005  Jonathan Blandford  <jrb@redhat.com>
213
214         * src/xdgmimecache.c: Patch from Matthias Clasen to mmap the
215         cached xdg file.
216
217 Mon Mar 28 13:58:32 2005  Jonathan Blandford  <jrb@redhat.com>
218
219         * src/xdgmimeglob.c (_xdg_glob_hash_insert_text): patch from
220         Matthias Clasen to handle globs that don't have '.' chars in
221         them.  As an example 'foo~' should match '*~'
222
223 Mon Mar 21 13:16:12 2005  Jonathan Blandford  <jrb@redhat.com>
224
225         * src/xdgmime.c (xdg_mime_shutdown): fix from  Axel Liljencrantz
226         <f97-ali@nada.kth.se> to free parent_list in shutdown.
227
228 2005-01-10  Christophe Fergeau  <teuf@gnome.org>
229
230         * src/xdgmimeglob.c: (_xdg_glob_hash_lookup_file_name): make previous
231         commit actually work...
232
233 2005-01-10  Christophe Fergeau  <teuf@gnome.org>
234
235         * src/xdgmimeglob.c: (_xdg_glob_hash_lookup_file_name): don't get
236         confused by multiple dots in filenames when doing extension matching
237
238 2004-12-13  Marco Pesenti Gritti  <marco@gnome.org>
239
240         * src/xdgmime.h:
241
242          wrap new API in XDG_ENTRY()
243
244 2004-12-13  Marco Pesenti Gritti  <marco@gnome.org>
245
246         * src/xdgmimeglob.c: (_xdg_glob_hash_lookup_file_name):
247
248         Do not assume the filename is UTF8. We just need to look
249         for the dot which is ASCII.
250
251 2004-12-09  Marco Pesenti Gritti  <marco@gnome.org>
252
253         * src/xdgmimeint.h:
254
255         Remove spacings I introduced by mistake
256
257 2004-12-09  Marco Pesenti Gritti  <marco@gnome.org>
258
259         * src/xdgmimealias.c: (_xdg_mime_alias_read_from_file):
260         * src/xdgmimeint.c: (_xdg_ucs4_to_lower):
261         * src/xdgmimeint.h:
262         * src/xdgmimeparent.c: (_xdg_mime_parent_read_from_file):
263
264         Check in Mariano Suárez-Alvarez <msuarezalvarez@arnet.com.ar> patch
265         for GNOME bug #160838.
266
267 2004-12-09  Marco Pesenti Gritti  <marco@gnome.org>
268
269         * src/xdgmimeglob.c: (_xdg_glob_hash_node_lookup_file_name):
270         * src/xdgmimeint.c: (_xdg_ucs4_to_lower):
271         * src/xdgmimeint.h:
272
273         Follow the freedesktop spec about case sensitiveness. Fix #732
274
275 2004-12-08  Christophe Fergeau  <teuf@gnome.org>
276
277         * src/xdgmimeglob.c: (_xdg_mime_glob_read_from_file): backing out
278         "fix" for bug #1048 since it frees memory that shouldn't be freed.
279
280 2004-12-08  Marco Pesenti Gritti  <marco@gnome.org>
281
282         * src/xdgmimemagic.c: (_xdg_mime_magic_read_from_file):
283
284         Check that fread succeeded reading all chars. Fix #1049
285
286 2004-12-08  Marco Pesenti Gritti  <marco@gnome.org>
287
288         * src/xdgmime.c:
289         * src/xdgmimealias.c:
290         * src/xdgmimeglob.c:
291         * src/xdgmimeint.c:
292         * src/xdgmimemagic.c:
293         * src/xdgmimeparent.c:
294
295         Include config.h. Fix #913
296
297 2004-12-08  Marco Pesenti Gritti  <marco@gnome.org>
298
299         * src/xdgmimealias.c: (_xdg_mime_alias_list_lookup):
300
301         Fix a typo
302
303 2004-12-08  Marco Pesenti Gritti  <marco@gnome.org>
304
305         * src/xdgmime.c: (xdg_mime_unalias_mime_type),
306         (xdg_mime_mime_type_equal), (xdg_mime_mime_type_subclass),
307         (xdg_mime_get_mime_parents):
308         * src/xdgmime.h:
309
310         Add apis to get parents and to unalias mime type
311
312 2004-12-08  Marco Pesenti Gritti  <marco@gnome.org>
313
314         * src/xdgmimealias.c: (_xdg_mime_alias_list_lookup):
315         * src/xdgmimeparent.c: (_xdg_mime_parent_list_lookup):
316
317         Protect against stupid bsearch() implementations.  (#1961,
318         Morten Welinder)
319
320 2004-12-08  Marco Pesenti Gritti  <marco@gnome.org>
321
322         * src/xdgmimeparent.c: (_xdg_mime_parent_read_from_file):
323
324         Initialize the parent field of the newly allocate list 
325         entry.  (#1916, Alex Larsson)
326
327 2004-12-08  Marco Pesenti Gritti  <marco@gnome.org>
328
329         * src/xdgmimeglob.c: (_xdg_mime_glob_read_from_file):
330
331         Patch from Matthias Clasen <mclasen@redhat.com> to fix
332         a mem leak. Bug #1048
333
334 2004-12-08  Marco Pesenti Gritti  <marco@gnome.org>
335
336         * src/xdgmimeglob.h:
337
338         Patch from Michael.Wilson@bull.net to fix compile error on AIX
339
340 Sun Nov  7 02:25:21 2004  Jonathan Blandford  <jrb@redhat.com>
341
342         * src/xdgmime.h: Patch from Matthias Clasen <mclasen@redhat.com>
343         to add alias and inheritence support.
344
345 2004-09-16  Christophe Fergeau  <teuf@gnome.org>
346
347         * src/xdgmimeglob.c: (_xdg_glob_hash_free_nodes):
348         * src/xdgmimemagic.c: (_xdg_mime_magic_free): fix memory leaks, 
349           fixes http://bugzilla.gnome.org/show_bug.cgi?id=152771 and
350           http://bugzilla.gnome.org/show_bug.cgi?id=152768
351
352 Mon Jul 19 00:23:00 2004  Jonathan Blandford  <jrb@gnome.org>
353
354         * src/xdgmime.c (xdg_mime_register_reload_callback): register a
355         callback when we reload MIME data.
356
357         * src/xdgmime.c (xdg_mime_remove_callback): Add capability to
358         remove callback.
359
360 Sun Jul 18 20:56:22 2004  Jonathan Blandford  <jrb@gnome.org>
361
362         * src/xdgmime.c (xdg_mime_shutdown):
363         (xdg_mime_init): reread data when it changes on disk.
364
365 Thu May 27 16:18:14 2004  Jonathan Blandford  <jrb@gnome.org>
366
367         * src/xdgmime.h: move xdg_mime_shutdown into the XDG_ENTRY guard.
368
369 Thu May 27 15:02:13 2004  Jonathan Blandford  <jrb@gnome.org>
370
371         * src/xdgmimemagic.c (_xdg_mime_magic_read_magic_file): patch from
372         Hongli Lai <h.lai@chello.nl> to catch magic files that don't end
373         with a '\n'.
374
375 Fri Apr 30 11:56:01 2004  Jonathan Blandford  <jrb@gnome.org>
376
377         * src/xdgmimemagic.c (_xdg_mime_magic_read_a_number): make the
378         buffer the right size.  Reported by Morten Welinder, #136323
379
380 Sun Mar 21 23:56:46 2004  Jonathan Blandford  <jrb@gnome.org>
381
382         * src/xdgmimemagic.c: Patch from Arjan van de Ven
383         <arjanv@redhat.com> to do s/fgetc/getc_unlocked/g.
384
385 Wed Mar 10 22:28:41 2004  Jonathan Blandford  <jrb@gnome.org>
386
387         * src/xdgmimemagic.c (_xdg_mime_magic_read_a_number): fix usage of
388         isdigit.  Reported by Morten Welinder, #136323
389
390         * src/xdgmimemagic.c (_xdg_mime_magic_read_magic_file): patch from
391         Christophe Fergeau to reverse the order of the matchlet before
392         adding it to the list.
393
394         * src/xdgmimeint.h (_xdg_utf8_skip): patch from Alexander Larsson
395         to make extern.
396
397 Wed Jan 21 09:29:41 2004  Jonathan Blandford  <jrb@gnome.org>
398
399         * src/xdgmimemagic.c (_xdg_mime_magic_insert_match): dropped
400         patches.  Fix.
401
402         * src/xdgmimeglob.c (_xdg_glob_hash_free_nodes): dropped patches.
403         Fix.
404
405 Tue Jan 20 14:55:39 2004  Jonathan Blandford  <jrb@gnome.org>
406
407         * src/xdgmime.h (XDG_MIME_TYPE_UNKNOWN): move the definition so
408         that it catches the XDG_ENTRY mangling.
409
410         * src/xdgmimemagic.c: make some functions static
411
412 Tue Jan 20 14:34:26 2004  Jonathan Blandford  <jrb@gnome.org>
413
414         * src/xdgmime.c (xdg_mime_get_max_buffer_extents): add function so
415         that it's easy to get the max buffer extents.
416
417 Tue Jan 20 12:55:55 2004  Jonathan Blandford  <jrb@gnome.org>
418
419         * src/Makefile: Test prefix code
420
421         * src/xdgmime*.h: Fully use the prefix code
422
423         * src/xdgmime.c: finish the syncing from both GTK+ and gnome-vfs.
424
425 Tue Jan 13 16:21:04 2004  Jonathan Blandford  <jrb@gnome.org>
426
427         * src/xdgmime.[ch] (XDG_MIME_TYPE_UNKNOWN): make an extern const
428         char * so that comparisons can work.
429
430         * src/xdgmimeint.c (_xdg_utf8_to_ucs4): patch from Dave Jones
431         <davej@redhat.com> to make operations more explicit.
432
433 Tue Oct 28 15:09:06 2003  Jonathan Blandford  <jrb@redhat.com>
434
435         * README: Add a readme, and clarify the licensing terms of the
436         software.
437
438 Tue Oct 28 14:47:37 2003  Jonathan Blandford  <jrb@redhat.com>
439
440         * src/xdgmime.c (xdg_mime_shutdown): implement shutdown.  This
441         frees all memory and resets to an uninitialized state as best as
442         possible.
443
444 Mon Oct 27 11:45:58 2003  Jonathan Blandford  <jrb@redhat.com>
445
446         * src/xdgmimemagic.c (_xdg_mime_magic_read_a_number): strtol
447         returns a long, not an int.  Thanks to Manish Singh for pointing
448         this out.
449
450         * src/xdgmimemagic.c (_xdg_mime_magic_parse_magic_line): change
451         assertion to avoid a warning.
452
453 Tue Oct 21 15:56:55 2003  Jonathan Blandford  <jrb@gnome.org>
454
455         * Makefile: add a simple makefile
456         * src/Makefile: ditto
457
458 Tue Jul 22 15:37:45 2003  Jonathan Blandford  <jrb@gnome.org>
459
460         * xdgmime/xdgmime.c (xdg_mime_init): use XDG_DATA_HOME instead of
461         XDG_CONFIG_HOME.
462