SubVersion: $Id$ Log of changes (libtifiles): - xx/xx/201x, version 1.1.8: debrouxl - 01/11/2016, version 1.1.7: debrouxl - move tifiles_{model_to_string,string_to_model} to libticonv, add torture tests, forward from libtifiles. - round out the sets of tifiles_ve_create* and tifiles_fp_create* functions, deprecate a couple ones. - harden the code; add new "display" family functions and improve / update existing ones; factor out some code; remove unused FlashHeader struct. Changes made while investigating the crash fixed by the previous commit. - fix tifiles_content_dup_flash() to dup FlashContent.data_part for the TI-eZ80 series. Fixes a crash in TILP reported by JustRamon and the same crash in GFM noticed by Lionel while investigating. - add comments containing data field offsets in files, so that they're easier to look up next time. - update file types. - add version field to backup files. - add initial support for 84+T model, fix several bugs in 82A support. - quit using deprecated libticonv and libarchive functions; fix three potential nullptr derefs (on invalid input) pointed by Coverity. - better handling of non-ASCII application names for 84+ family. - in the torture tests, use __LINE__ instead of a counter, and remove some of the blank lines. Suggested by Benjamin Moody. - leverage ticonv_varname_to_utf8_sn() to simplify a significant number of repeated code snippets in calc_*.c; use ticonv_varname_to_utf8_sn() instead of ticonv_varname_to_utf8_s(). - add and rewrite functions related to calc model categories and protocol support; replace a number of g_free() calls by wrapper of g_free() calls; add torture tests for the new functions. - libtifiles: improve filetype support for the 82A, which has .82u extension for OS upgrades; all known TI-eZ80 FlashApps use the .8ek extension, so remove the two occurrences of .8pk; fix two 73 file extensions. - inline our trivial logging functions, which enables checking arguments wrt. format (without putting format annotations, that is), fix several bugs uncovered by this change; remove all remaining occurrences of TRYC from libticables. - add Travis CI integration. - replace deprecated AC_PROG_LIBTOOL with LT_INIT. - in ti8x_file_write_regular(), do not take attr into account twice when computing checksum. Reported by jacobly. - import several functions from libti* clients (tilp, titools). Most functions made and/or suggested by Benjamin Moody. - add a set of certificate parsing functions, suggested by Benjamin Moody. Implementation sketched by Benjamin and Lionel. - add several IDs to types84p.h; fix a couple 83PCE/84+CE file extensions; large refactoring in types*, reducing code duplication a lot. - export several functions from filetypes.c to the public API, add torture tests. - remove "XXx" file extensions for group and backup types on models which don't support them; make it possible to disable a number of file extension checks (for testing purposes); in tifiles_file_is_ti(), call tifiles_file_has_tifl_header(). - move the trivial functions from types*.c to the corresponding types*.h under inlinable form. Synchronize the implementations. - move the trivial functions (i.e. most functions) from rwfile.c to rwfile.h under inlinable form. While at it, make byte / character count arguments unsigned. Also, rwfile.c::hexdump() -> misc.c::tifiles_hexdump(), with size-limiting. - make FileContent.num_entries, FlashContent.num_pages, TigContent.n_vars, TigContent.n_apps, CableOptions.timeout, CableOptions.delay unsigned; have several functions of the API take or return unsigned int instead of int. - scattered fixes resulting from Coverity Scan, afl-fuzz and code inspection. - add a number of helper functions for symmetry, add them to the torture tests, and fix memory leaks & memory errors in the torture tests and/or the libraries. - fix -Wmissing-prototypes warnings, as suggested by Benjamin Moody; fix the build on FreeBSD 10; cleanup for MacOS X (twice, Adrien "Adriweb" Bertrand reported a buggy change). - handle TI-eZ80 FlashApp & OS files like TI-68k FlashApp & OS files; libticalcs: add a sanity check on FlashContent at three places, and fix the maximum size for a Flash variable on the TI-68k series. - libtifiles: make several function arguments const or unsigned, slightly proofread tigroup.c; libticalcs: get rid of TRYF in several more files, add brackets around if / for bodies, whitespace changes. - in the README, mention that autoreconf needs to be run before ./configure can run. Reported by SirCmpwn. - switch to a single, unconditional definition of CalcModel in ticonv.h, include ticonv.h from tifiles.h. The libtifiles binaries have depended on libticonv for years. Suggested by Benjamin Moody. - add initial support for 83PCE / 84+CE / 84+CE-T and 82A calc models, improve support for the 84+CSE (legacy I/O and USB) models, with a sprinkling of refactoring. - fix dozens of more (UAF, DF, OOB accesses) or less (tiny memory leaks, dead code) severe issues reported by Coverity Scan. In the process, overhaul test_tifiles_2.c (not that it can actually run in a meaningful way), and add tifiles_free_table_of_entries() API. Several other issues found by code inspection. - remove some now-unused lists of file extensions. - use TIFL header to identify apps and OSes. - handle version compatibility byte for 83+/84+ variables. - remove some unused and outdated data arrays. - fix handling of TI-83 files mislabeled as 83+ and vice versa. - Add .gitignore, remove globbing from libtifiles makefile.am, fix a warning in libticables error.c, remove unneeded config.h.in - review error files. Have ticalcs_error_get() uniformly use g_strconcat/g_strdup like tifiles_error_get() and ticables_error_get(), instead of strcpy+strcat+g_strdup with a statically-sized buffer on the stack. - produce export (def) files on Win32. - remove more auto-generated / copied files from the repository; upgrade gettext dependency to 0.18 (from May 2010). - attempt to support Intel Hex files with CR and LF line endings, since TI-Connect supports OS files with LF line endings. Reported by SirCmpwn. - fix buffer overflow spotted by AddressSanitizer. - in torture tests, print local traces to stderr instead of stdout. This restores `make check` output with recent autotools versions. - remove auto-generated configure & Makefile.in from the repository. - in order to prevent implicit overlinking, use more Requires.private in pkgconfig definitions, instead of Requires. Patch mainly by Tijl Coosemans. - fix memory corruption with large FlashApps. Reported by fortytwo and fb39ca4, patch by fortytwo (modified the comment). - fix wrong loop exit condition in tifiles_ve_delete_array(), noticed while making the hpfiles part of libhpcalcs. - add 84+CSE calc models, and image types. - 31/03/2013, version 1.1.6: debrouxl - regenerate with Autoconf 2.69 and Automake 1.11.5. - add "torture test" programs for testing how functions of the public API react to NULL parameters. - fix several malloc/realloc/free vs. g_malloc/g_malloc0/g_free mismatches. - regenerate with Automake 1.11.6. - use LF line endings throughout the sources. - add initial, experimental TI-80 VSC support, by Randy Compton. - convert README to UTF-8. - add support for Nspire OS extensions, such as (and currently limited to) the English-Chinese dictionary. - fix some spelling errors (or at least, infrequent forms) reported by Lintian (through Albert "alberthro" Huang) and rpmlint (through TC01). - fixes for i18n problems reported by Benjamin Moody. - for dealing with ZIP files, use an external libarchive instead of an embedded minizip. - fix a number of problems related to unaligned reads/writes and left shifts of count >= width of type; fix more compiler warnings reported by clang. - fix more compiler warnings reported (or made more visible) by clang. - improve the comment of tifiles_file_read_regular. Reformat and files8x.c, files9x.c, filesnsp.c and add traces. - improve tifiles_group_files and tifiles_ungroup_file. - 14/12/2011, version 1.1.5: debrouxl - add Nspire CX OS support (.tco & .tcc extensions). - upgrade COPYING files and FSF addresses embedded in files, so as to make rpmlint happier. - in tifiles_string_to_model, handle short (without "TI") and "p" (instead of "+") variants of the models' names. - reconfigure with autoconf 2.68 and libtool 2.4. - 83+(SE)/84+(SE) group files generated by TI's software have the .8xo extension. Use it, rather than 8xgrp. - make tifiles_fext_get not crash if passed NULL, reported by Jon Sturm. - recognize Nspire CM (CAS) boot2/OS upgrades (.tmo & .tmc extensions) as such. - upgrade embedded minizip from 1.01e to 1.01h. - tigroup.c: remove copy of g_chdir suitable for old GLib versions that we don't support anymore. - reconfigure with libtool 2.4.2. - take a whack at hundreds of NULL pointer dereferences by sanitizing function arguments. - upgrade version of gettext to 0.17, released in late 2007. - 28/05/2011, version 1.1.4: debrouxl - remove autogenerated Changelog files and empty TRANSLATORS files. - change encoding in .rc file. - compiler warning fixes - minor changes to make autotools definitions work with both libtool 1.x and 2.x. - use AM_GNU_GETTEXT_VERSION to use a consistent version of gettext (namely 0.16, released in late 2006). - prevent several NULL dereferences. - don't crash upon sub-folders of folders. - prevent a number of NULL dereferences, and turn abrupt program aborts such as assert() and exit() into tests + ti*_critical(). - reconfigure under Debian Squeeze with Autoconf 2.67 and Automake 1.11.1. - add VS 2008 project/solution files - documentation and comment updates. - support sample-less [Nspire] OS 3.0.1.1753. - 08/04/2010, version 1.1.3: debrouxl - added a missing output value initialization, which can cause failure to send some 83+ FlashApps (bug #2792446). Patch by Benjamin Moody. - downgraded "error" (which abruptly aborts the program) to "critical". - major fixes for TI-83+ and TI-89 family file handling functions (groups, checksums). - removed the local copy of an older version of g_fopen, it isn't necessary anymore. - updated translations. - updated to Autoconf 2.65. - 29/05/2009, version 1.1.2: roms - fixed possible buffer overflow - 11/03/2007, version 1.1.1: roms - added NSpire CAS OS file support - 04/10/2007, version 1.1.0: roms - adding NSpire support... - TiConnect compresses application in TiGroup; does (almost) the same - increased string size of VarEntry structure from 33 to 1024 for NSpire - typesXX.c: are icon & desc fields swapped? (icon should not be localized) - 18/09/2007, version 1.0.8: roms - added file extension for GRP variables - 20/06/2007, version 1.0.7: roms - replaced malloc/free by g_malloc/g_free - slightly modified TigContent structure - fixed ti8x_file_write_read (better end of file check) - fixed some TI-86 types (Window Settings) - fixed names of TI83+/84+/86 types - updated to follow some ticonv API changes - 10/06/2007, version 1.0.6: roms - fixed sending of TIG files: set model as TI84P_USB to enable UTF8 conversion - fixed TI83 types: WINDW, ZSTO and TAB were missing - some functions (tifiles_content_dup_XXX) were present and exported but didn't appear in tifiles.h header - 16/04/2007, version 1.0.5: kevin - requires glib >= 2.6.0 rather than 2.4.0 because libticonv requires it anyway - 23/02/2007, version 1.0.4: roms - enabled i18n - 08/12/2006, version 1.0.3: - added new values to FileClass enumeration (os, app and tib) and added the following convenient functions: tifiles_file_is_os and tifiles_file_is_app. - added tifiles_file_test function which was planned for a while. - fixed tifiles_file_write_tigroup which deleted the output file! - fixed tifiles_file_test (some copy&paste errors) - added missing type (TI83_ASM) - implemented matching check for TiGroup in tifiles_file_test - 12/11/2006, version 1.0.2: - don't check device_type if data_type is TI89_LICENSE, old 89u files use DEVICE_TYPE_73 (kevin) - 21/09/2006, version 1.0.1: - fixed miniunz.c and minizip.c trying to include DOS/Win32 headers under OS X (kevin) - changed TIEXPORT into TIEXPORT2 - again, disabled file checksum verification - 17/09/2006, tagged as version 1.0.0: roms - added support for TILIBS_DEPRECATED (exports symbols which have been tagged as deprecated) - 16/09/2006, version 0.2.9: roms - added hw_id field to FlashContent structure - 08/09/2006, version 0.2.8: roms - fixed tifiles_ve_dup - fixed grouped.c: check for NULL pointer - tigroup.c: use #ifndef __WIN32__ instead of #ifdef __LINUX__ to check for strcasecmp vs. stricmp (kevin) - tigroup.c: fixed code typos (missing asterisk, m instead of n)(kevin) - fixed computation of checksum with TI8x files - fixed tigroup.c: check for NULL pointer - check for device/data type in FLASH file - 25/08/2006, version 0.2.7: roms - checked with Valgrind, tested and validated. - 17/08/2006, version 0.2.6: roms - added grouping/ungrouping support for TiGroup (eg tigroup.c provides the same API as grouped.c) => note: no functions removed/renamed; just added new ones - added tifiles_file_write_flash2 in order not to break API - added tifiles_content_dup_regular/flash (not exported) - fixed TI8x file support (introduced bug with fortification) - added tifiles_build_filename function (which replaces built-in/static code in various places and some built-in code in TiLP). - tifiles_content_write_flash: build filename from the last header (=data). - fortified group.c: release memory on error exit - 10/08/2006, version 0.2.5: roms - improved TiGroup support API - fixed Travis Evans' bug: can't read some TI86 files due to bad padding of varname => there are 4 TI-86 file format! - set model_dst to model if dst is not specified (=CALC_NONE) - fixed tifiles_has_backup (don't include USB hand-helds) - 07/08/2006, version 0.2.4: roms - fortified rwfile.c - fortified files8x.c - fortified files9x.c - 06/08/2006, version 0.2.3: roms - target hand-held is passed by tifiles_content_create_xxxx - fortified tigroup.c - 12/07/2006, version 0.2.2: roms - variables like 'beta' can't be handled by TiGroup file nor ZIP archives. Translate filenames again! - for now, use this naming scheme for TI9x var filenames: folder.var.extension - look for the correct module file name on MinGW in tifiles_library_init (kevin) - fixed _FORTIFY_SOURCE and strict-aliasing (and a few harmless) warnings (kevin) - 06/07/2006, version 0.2.1: roms - bug #1499672: every edit-locked BASIC and AMS program is marked ASM and received as *.8xz, of course this has to be *.8xp for both locked BASIC and ASM. - reverted back changes made on tifile encoding <-> raw varname encoding (v0.1.2) because this code had no effect. Moreover, it will imply to pass target hand-held to convert varname in the right encoding. For now, this step is postponed on ticalcs2 library. - reverted back again - replaced fopen by gfopen in ZIP I/O callbacks (locale/utf8) - 17/06/2006, version 0.2.0: roms - full TiGroup support (both regular & flash with deflate compression) - 05/06/2006, version 0.1.5: roms - renamed stdints.h into stdints2.h - 16/05/2006, version 0.1.4: roms - fixed bug in tifiles_file_is_tib which didn't detect TIB files. - 16/04/2006, version 0.1.3: roms - thanks to O. Armand, fixed a bug in the file attribute (archived flag) - ti8x_read_flash now returns in FlashContent.data_length the length of pure data instead of file size (TI8x FLASH file format) - 07/04/2006, version 0.1.2: roms - increased buffer length of variable & folder names (9 -> 36) due to TI-UTF-8 - checked for usb calcs support - fixed warnings - 16/03/2006, version 0.1.1: roms - free the block itself in tifiles_content_delete_xxxxx - clean-up (removed dead code) - 23/02/2006, version 0.1.0: roms - removed deprecated functions - 21/02/2006, version 0.0.9: roms - moved transcode support as deprecated (superseded by ticonv libary) - switched to ticonv - 20/02/2006, version 0.0.8: roms - error message is a glib allocated string for now. - 08/02/2006, version 0.0.7: roms - added tifiles_varname_to_filename which converts varname with sepcial characters (like alpha, beta, ...) into valid filename according to locale - tifiles_file_write_regular can now auto-saves files with greek characters - 02/02/2006, version 0.0.6: roms - replaced fopen calls by g_fopen calls: the library uses GLib encoding on filenames for now (UTF-8 on Windows, locale on Linux (usually UTF-8, too)). - optimized tifiles_file_is_ti() - fixed tifiles_file_get_type for TiGroup support - 22/01/2006, version 0.0.5: roms - removed 'tifiles_create_table_of_entries' from export - pass CalcModel to 'tifiles_content_create_xxxx' => increased so major number - added functions for adding/removing entr(y)ies in regular file => the last two changes have been done to avoid/minimize manipulation of internal fields in FileContent structure (make them opaque/private) - added full TiGroup (*.tig) support: read, write, list - removed a limitation in 'tifiles_group_contents': the src content is now fully copied (not limited to first element like single file) - reverted back the changes made on 'fopen' and 'UTF-8' - 14/01/2006, version 0.0.4: roms - replaced assertion checks by warnings in the typesXX.c modules. - support UTF-8 filenames - added tifiles_file_is_tig function - the content->comment field is now initialized in tifiles_content_create_xxx - 15/09/2005, version 0.0.3: roms - fixed reading of TIB files. - 14/09/2005, version 0.0.2: roms - file checksums - buffer overflow in tixx_translate functions - fixed build of docs/ (Tijl) - export missing macros.h - 04/06/2005, version 0.0.1: roms - added transcode function to API for future implementation - removed 'name' field of VarEntry: make confusion - changed 'var_name' into name and 'fld_name' into 'folder' - added checksum verification - 14/05/2005, version 0.0.1: roms - merged some types into a single type - common file handling API - 10/04/2005, version 0.0.1: roms - rewritten TI8X+ FLASH support - fixed memory errors at: * test_tifiles_2.c:168 * realloc in ti8x_file_read_flash * free in ti8x_content_free_flash - new valgrind check: no errors ! Add TiGroup (*.tig) support which is a kind of file container. - 26/03/2005, version 0.0.1: roms - error management left untouched - logging reworked (use glib) - a single public header with functions & defs, others are private - slightly fixed namespace sheme - use strong types such as TiCalcModel, ... - glib is used for logging (not very much for strings) - documentation system has been changed - functions pointers have been removed - library has been fully documented - decreased number of headers to include (1 or 3) - fixed tifiles_file_is_ti and argument passing to transcode functions - added fread_n_bytes adn fwrite_n_bytes which replaces fwrite_n_chars - fixed many missing fclose() => file truncated... - fixed fsignature in TI8x support - checked with valgrind: few allocations errors with test_tifiles_2.c - added a new convenient function: tifiles_content_free_group - tifiles_ungroup_file now returns a list of files extracted from group file - fixed few memory allocation issues with ValGrind. ====[ Version II ]==== - 05/03/2005, version 0.6.3: roms Added gcc 4.0 -fvisibility flag support. - 03/11/2004, version 0.6.2: roms Fixed and tested TIB file support (read only). - 18/09/2004, version 0.6.1: roms Added TI89 Titanium support. File format seems to be the same as TI89. Added TI84+ (SE) support. File format seems to be the same as TI83+. - 02/07/2004, version 0.6.0: roms Loading of TI9x flash upgrades is less restrictive now. It can accept badly formatted files. Added checking for TI89 Titanium but FLASH upgrades have same extension and same header. - 22/04/2004, version 0.5.9: roms Patch from Adrian Mettler merged. His patch fixes some TI85/86 file handling issues about varname (padded, not padded). Patch from Benjamin Moody <> merged. His patch fixes a crash when TiLP is parsing a file which contains the TI signature but has no extension. - 08/04/2004, version 0.5.8: roms Redirection of stdout/stderr. Fixed TI85/TI86 varname encoding bug. Added/improved TIB file support. - 27/08/2003, version 0.5.7: maintenance release by JB. Use AM_MAINTAINER_MODE in configure.in Upgraded to automake 1.7 Upgraded to libtool 1.5 - 01/05/2003, version 0.5.6: Added 'mu' char to TI89..V200. Unicode translation was missing for TI92(+)/V200. trans.c has been hugely reworked: - varname detokenization - TI-charset to user-selected charset transcoding - 19/04/2003, version 0.5.5: Added various varname translations (ASCII, ISO8859-1 and UTF-8). Some fields have been extended (trans[9] -> trans[17]) to store Unicode strings. tifiles_vartype2icon was missing. Some icons name was internationalized. - 15/04/2003, version 0.5.4: Interface reworked for better consistency. Returns int instead of uint8_t for tifiles_folder/flash/idlist_type. - 05/04/2003, version 0.5.3: Added a column to the TI73_CONST[] array (localized). The previous column is used as icon name (non localized). i18n enabled for Windows. indent -kr -i2 - 30/03/2003, version 0.5.2: i18n updated. Included French translations. Code source parsed for _() occurences. - 18/03/2003, version 0.5.1 (testing phase): Fixed V200 types. Fixed TI83+ types (> instead of <). - 09/03/2003, version 0.5.0: Added type to string conversion functions. - 08/03/2003, version 0.4.9: Group files from FLASH calculators are not considered as backup any longer. - 23/02/2003, version 0.4.8: Bug fix thanks to Kevin McCormick : << ] |5D00000000000000|L1 |0 |01 |0000006E| ] |5D01000000000000|L2 |0 |41 |00000146|>> there was no out-of-bounds protection in ti83p_byte2desc() and others. Tijl's workaround added about this (AND with 0x1f). - 08/02/2003, version 0.4.7: Removed glib dependancy. tifiles library does not have any dep ! Fixed macros.h for BSD. - 08/02/2003, version 0.4.6: Bug report from Thomas Otto <3.1415926535897932384626433832@gmx.net>: <<$ mkdir testink $ mkfifo testink/fifo $ tilp #(gtk mode) and chanke into this dir -> freeze.>> Fixed by checking file type before opening the file in typesxx.c. Added .89y/.9xy extension for ppg variables (ebook). - 03/02/2003, version 0.4.5: Some #define have been changed into enum (make code & doc better). - 23/01/2003, version 0.4.4: stdint.h encapsulated for Win32 & BSD ports. Added BSD target to configure.ac and Tijl's patches merged. - 18/01/2003, version 0.4.3: configure.ac cleaned-up. Compilable with MinGW (under MSYS and CygWin). - 23/12/2002, version 0.4.2: Added pkg-config support. - 22/12/2002, version 0.4.1b: Doc added. - 08/12/2002, version 0.4.1: Modified to be (cross-)compilable with MinGW. - 15/11/2002, version 0.4.0: configure.ac improved. - 26/09/2002, version 0.3.9: Some functions added for Win32 (calloc/malloc/realloc/free). - 26/09/2002, version 0.3.8: Win32 port & fixes. - 16/09/2002, version 0.3.7: Win32 port. - 08/09/2002, version 0.3.6: tifiles_translate_varname modified. - 04/09/2002, version 0.3.5: The trans field (TiVarEntry) was not filled ! Added 2 new functions: tifiles_get_fldname & tifiles_get_varname - 01/09/2002, version 0.3.4: Added tifiles_idlist_type function. Added new type: clock ! - 31/08/2002, version 0.3.3: Testing phase: little fix in read_regular_file for TI83+ and group files. - 26/08/2002, version 0.3.2: Added V200 support (same file format as TI92+). - 23/08/2002, version 0.3.1: Added a descriptive for each TI file extension. - 21/08/2002, version 0.3.0: TI83+ FLASH support fixed. TI89 FLASH support in writing fixed. - 18/08/2002, version 0.2.9: some TI73 fixes. - 15/08/2002, version 0.2.8: added some functions for allocating & initializing structures. - 14/08/2002, version 0.2.7: added a new header (wrapper): tifiles.h - 11/08/2002, version 0.2.6: TiVarEntry modified (some names of field) - 09/08/2002, version 0.2.5: Little fix in TI9x support. - 27/07/2002, version 0.2.4: TI83+ FLASH support updated. Little bug fix in typesxx.c (TIXX_FLASH) - 22/07/2002, version 0.2.3: A fix in Ti8x (86) support (backup, part3 mey be NULL). - 20/07/2002, version 0.2.2: Some functions added. - 19/07/2002, version 0.2.1: Built under win32 -> some incompatible changes. - 18/07/2002, version 0.2.0: Compiled under Win32. Added a more robust error checking. Can be considered as stable. - 15/07/2002, version 0.1.1: TI8X/9X share a common Regular structure... - 14/07/2002, version 0.1.0: Grouping/Ungrouping support finished & tested. TI9x support has been extensively tested (with FLASH support): OK ! - 12/07/2002, version 0.0.9: TI8x support has been extensively tested (except FLASH support): OK ! - 10/07/2002, version 0.0.8: Some headers moved from libticables to libtifiles. - 05/07/2002, version 0.0.7: TI9x support added. - 04/07/2002, version 0.0.6: Merged concurrent modifications. - 30/06/2002, version 0.0.5: Some defs changed (CALC_...) but not enabled yet. - 26/06/2002, version 0.0.4: Win32 port and bug fixes. - 24/06/2002, version 0.0.3: TI82 grouping/ungrouping added. - 23/06/2002, version 0.0.2: TI82 support finished. - 10/06/2002, version 0.0.1: First version.