diff --git a/CMakeLists.txt b/CMakeLists.txt index e915a160f..56579ef33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -175,6 +175,7 @@ add_subdirectory(libticonv/trunk) add_subdirectory(libtifiles/trunk) add_subdirectory(libticables/trunk) add_subdirectory(libticalcs/trunk) +add_subdirectory(tifileutil) add_custom_target(check DEPENDS ticonv_check tifiles2_check ticables2_check ticalcs2_check diff --git a/libticalcs/trunk/configure.ac b/libticalcs/trunk/configure.ac index 3ec257ed3..68319a897 100644 --- a/libticalcs/trunk/configure.ac +++ b/libticalcs/trunk/configure.ac @@ -36,7 +36,6 @@ AC_CONFIG_FILES([ docs/Makefile po/Makefile.in src/Makefile - src/tf2hex/Makefile src/romdump_8x/Makefile src/romdump_84p_usb/Makefile src/romdump_9x/Makefile @@ -204,12 +203,12 @@ AC_ARG_ENABLE([builtin-rom-dumpers], [], [enable_builtin_rom_dumpers=yes]) AC_ARG_VAR([SPASM], [SPASM Z80 assembler]) -AC_ARG_VAR([TIPACK], [Tool for creating TI variable files]) +AC_ARG_VAR([TIFILEUTIL], [Tool for creating TI variable files]) have_spasm=no -have_tipack=no +have_tifileutil=no have_tigcc=no : ${SPASM=spasm} -: ${TIPACK=tipack} +: ${TIFILEUTIL=tifileutil} if test "x$enable_builtin_rom_dumpers" != "xyes" ; then AC_MSG_CHECKING([whether $SPASM works]) @@ -224,13 +223,11 @@ EOF fi AC_MSG_RESULT([$have_spasm]) - if test "x$have_spasm" = "xyes" ; then - AC_MSG_CHECKING([whether $TIPACK works]) - if "$TIPACK" conftest.bin -p -o conftest.8xp >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then - have_tipack=yes - fi - AC_MSG_RESULT([$have_tipack]) + AC_MSG_CHECKING([whether $TIFILEUTIL works]) + if "$TIFILEUTIL" wrap conftest.bin -p -o conftest.8xp >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then + have_tifileutil=yes fi + AC_MSG_RESULT([$have_tifileutil]) AC_MSG_CHECKING([whether tigcc works]) cat >conftest.c < -#include -#include -#include - -#define STEP 8 - -int main(int argc, char **argv) -{ - const char *src_name; - const char *dst_name; - FILE *fi, *fo; - struct stat st; - long length, lenread; - static unsigned char data[65536]; - int i, j; - const char *pat; - - if(argc != 4) - { - fprintf(stderr, "Usage: tf2hex input_file output_file suffix\n"); - return 1; - } - - src_name = argv[1]; - dst_name = argv[2]; - pat = argv[3]; - - // read input file - fi = fopen(src_name, "rb"); - if(fi == NULL) - { - fprintf(stderr, "Unable to open input file.\n"); - return 1; - } - - fstat(fileno(fi), &st); - length = st.st_size; - - lenread = fread(data, sizeof(char), length, fi); - fprintf(stdout, "Read %ld bytes.\n", lenread); - - fclose(fi); - - if (lenread == length) - { - // write output file - fo = fopen(dst_name, "wt"); - if(fo == NULL) - { - fprintf(stderr, "Unable to open output file.\n"); - return 1; - } - - fprintf(fo, "static unsigned char romDump%s[] = {\n", pat); - for(i = 0; i < length; i += STEP) - { - for(j = 0; (j < STEP) && (i+j < length); j++) - { - fprintf(fo, "0x%02x, ", data[i + j]); - } - fprintf(fo, "\n"); - } - fprintf(fo, "};\nstatic unsigned int romDumpSize%s = %ld;\n", pat, length); - - fclose(fo); - } - else - { - fprintf(stderr, "Was unable to read the entire input file.\n"); - return 1; - } - - return 0; -} diff --git a/libticalcs/trunk/src/tf2hex/tf2hex.dsp b/libticalcs/trunk/src/tf2hex/tf2hex.dsp deleted file mode 100644 index 6d662d189..000000000 --- a/libticalcs/trunk/src/tf2hex/tf2hex.dsp +++ /dev/null @@ -1,101 +0,0 @@ -# Microsoft Developer Studio Project File - Name="tf2hex" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=tf2hex - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "tf2hex.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "tf2hex.mak" CFG="tf2hex - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "tf2hex - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "tf2hex - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "tf2hex - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x40c /d "NDEBUG" -# ADD RSC /l 0x40c /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "tf2hex - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE RSC /l 0x40c /d "_DEBUG" -# ADD RSC /l 0x40c /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"tf2hex.exe" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "tf2hex - Win32 Release" -# Name "tf2hex - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\tf2hex.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/libticalcs/trunk/src/tf2hex/tf2hex.dsw b/libticalcs/trunk/src/tf2hex/tf2hex.dsw deleted file mode 100644 index 250de3be3..000000000 --- a/libticalcs/trunk/src/tf2hex/tf2hex.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "tf2hex"=.\tf2hex.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/libticonv/trunk/src/ticonv.h b/libticonv/trunk/src/ticonv.h index c5dbfa4d3..643e0b87b 100644 --- a/libticonv/trunk/src/ticonv.h +++ b/libticonv/trunk/src/ticonv.h @@ -186,6 +186,7 @@ typedef struct TIEXPORT4 char* TICALL ticonv_varname_detokenize(CalcModel model, const char *src, unsigned char type); // TODO TIEXPORT4 char* TICALL ticonv_varname_tokenize_sn(CalcModel model, const char *src, char *dst, uint32_t maxlen, unsigned char type); TIEXPORT4 char* TICALL ticonv_varname_tokenize (CalcModel model, const char *src, unsigned char type); + TIEXPORT4 char* TICALL ticonv_varname_strdup (char *varname); TIEXPORT4 void TICALL ticonv_varname_free (char *varname); // filename.c diff --git a/libticonv/trunk/src/tokens.cc b/libticonv/trunk/src/tokens.cc index ab041157e..1680023b8 100644 --- a/libticonv/trunk/src/tokens.cc +++ b/libticonv/trunk/src/tokens.cc @@ -721,6 +721,22 @@ TIEXPORT4 char* TICALL ticonv_varname_tokenize(CalcModel model, const char *src_ return g_strdup(src_); } +/** + * ticonv_varname_strdup: + * @varname: string to be duplicated. + * + * This function is mostly meant for internal use: duplicating a non-tokenized string with the same allocation function ticonv_varname_tokenize(), + * so that it can be passed to ticonv_varname_free(). + **/ +TIEXPORT4 char* TICALL ticonv_varname_strdup(char * varname) +{ + if (NULL == varname) + { + return NULL; + } + return g_strdup(varname); +} + /** * ticonv_varname_free: * @varname: previously allocated varname string to be freed. diff --git a/libticonv/trunk/tests/torture_ticonv.c b/libticonv/trunk/tests/torture_ticonv.c index a5a40d5da..676c0460a 100644 --- a/libticonv/trunk/tests/torture_ticonv.c +++ b/libticonv/trunk/tests/torture_ticonv.c @@ -134,10 +134,11 @@ int main(int argc, char **argv) retval = ticonv_varname_tokenize(-1, NULL, 0); PRINTF(, STR, retval); ticonv_varname_free(retval); + PRINTFVOID(ticonv_varname_strdup, NULL); PRINTFVOID(ticonv_varname_free, NULL); + retval = ticonv_utf16_to_gfe(-1, NULL); PRINTF(, STR, retval); - ticonv_gfe_free(retval); PRINTFVOID(ticonv_gfe_free, NULL); retval = ticonv_gfe_to_zfe(-1, NULL); @@ -156,8 +157,8 @@ int main(int argc, char **argv) // charset.h PRINTF(ticonv_ti73_to_utf16, PTR, NULL, (void *)0x12345678); PRINTF(ticonv_ti73_to_utf16, PTR, (void *)0x12345678, NULL); - PRINTF(ticonv_ti80_to_utf16, PTR, NULL, (void *)0x12345678); + PRINTF(ticonv_ti80_to_utf16, PTR, NULL, (void *)0x12345678); PRINTF(ticonv_ti80_to_utf16, PTR, (void *)0x12345678, NULL); PRINTF(ticonv_ti82_to_utf16, PTR, NULL, (void *)0x12345678); PRINTF(ticonv_ti82_to_utf16, PTR, (void *)0x12345678, NULL); @@ -167,8 +168,8 @@ int main(int argc, char **argv) PRINTF(ticonv_ti83p_to_utf16, PTR, (void *)0x12345678, NULL); PRINTF(ticonv_ti85_to_utf16, PTR, NULL, (void *)0x12345678); PRINTF(ticonv_ti85_to_utf16, PTR, (void *)0x12345678, NULL); - PRINTF(ticonv_ti86_to_utf16, PTR, NULL, (void *)0x12345678); + PRINTF(ticonv_ti86_to_utf16, PTR, NULL, (void *)0x12345678); PRINTF(ticonv_ti86_to_utf16, PTR, (void *)0x12345678, NULL); PRINTF(ticonv_ti9x_to_utf16, PTR, NULL, (void *)0x12345678); PRINTF(ticonv_ti9x_to_utf16, PTR, (void *)0x12345678, NULL); @@ -178,8 +179,8 @@ int main(int argc, char **argv) PRINTF(ticonv_utf16_to_ti80, PTR, (void *)0x12345678, NULL); PRINTF(ticonv_utf16_to_ti82, PTR, NULL, (void *)0x12345678); PRINTF(ticonv_utf16_to_ti82, PTR, (void *)0x12345678, NULL); - PRINTF(ticonv_utf16_to_ti83, PTR, NULL, (void *)0x12345678); + PRINTF(ticonv_utf16_to_ti83, PTR, NULL, (void *)0x12345678); PRINTF(ticonv_utf16_to_ti83, PTR, (void *)0x12345678, NULL); PRINTF(ticonv_utf16_to_ti83p, PTR, NULL, (void *)0x12345678); PRINTF(ticonv_utf16_to_ti83p, PTR, (void *)0x12345678, NULL); @@ -189,8 +190,8 @@ int main(int argc, char **argv) PRINTF(ticonv_utf16_to_ti86, PTR, (void *)0x12345678, NULL); PRINTF(ticonv_utf16_to_ti9x, PTR, NULL, (void *)0x12345678); PRINTF(ticonv_utf16_to_ti9x, PTR, (void *)0x12345678, NULL); - PRINTF(ticonv_ti84pusb_to_utf16, PTR, NULL, (void *)0x12345678); + PRINTF(ticonv_ti84pusb_to_utf16, PTR, NULL, (void *)0x12345678); PRINTF(ticonv_ti89tusb_to_utf16, PTR, NULL, (void *)0x12345678); PRINTF(ticonv_utf16_to_ti84pusb, PTR, NULL, NULL); PRINTF(ticonv_utf16_to_ti89tusb, PTR, NULL, NULL); @@ -200,8 +201,8 @@ int main(int argc, char **argv) PRINTF(ticonv_ti89tusb_to_utf16, PTR, (void *)0x12345678, NULL); PRINTF(ticonv_utf16_to_ti84pusb, PTR, NULL, (void *)0x12345678); PRINTF(ticonv_utf16_to_ti84pusb, PTR, (void *)0x12345678, NULL); - PRINTF(ticonv_utf16_to_ti89tusb, PTR, NULL, (void *)0x12345678); + PRINTF(ticonv_utf16_to_ti89tusb, PTR, NULL, (void *)0x12345678); PRINTF(ticonv_utf16_to_ti89tusb, PTR, (void *)0x12345678, NULL); charset_functions_unit_test(); diff --git a/libtifiles/trunk/po/de.po b/libtifiles/trunk/po/de.po index 697631653..4459e4d7b 100644 --- a/libtifiles/trunk/po/de.po +++ b/libtifiles/trunk/po/de.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: libtifiles2 1.1.8\n" "Report-Msgid-Bugs-To: tilp-users@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-10-21 21:38+0200\n" +"POT-Creation-Date: 2023-01-29 22:27+0100\n" "PO-Revision-Date: 2019-10-29 14:15+0100\n" "Last-Translator: Andreas B. Mundt \n" "Language-Team: \n" @@ -196,56 +196,56 @@ msgstr "Ausdruck" #: src/types68k.cc:78 src/types68k.cc:79 src/types68k.cc:80 src/types68k.cc:81 #: src/types68k.cc:82 src/types68k.cc:83 src/types68k.cc:84 src/types68k.cc:85 #: src/types68k.cc:86 src/types83p.cc:44 src/types83p.cc:45 src/types83p.cc:49 -#: src/types83p.cc:53 src/types83p.cc:55 src/types83p.cc:60 src/types83p.cc:69 -#: src/types83p.cc:73 src/types83p.cc:74 src/types83p.cc:75 src/types83p.cc:76 -#: src/types83p.cc:77 src/types83p.cc:78 src/types83p.cc:79 src/types83p.cc:80 -#: src/types83p.cc:81 src/types83p.cc:82 src/typesoldz80.cc:49 -#: src/typesoldz80.cc:50 src/typesoldz80.cc:53 src/typesoldz80.cc:54 -#: src/typesoldz80.cc:58 src/typesoldz80.cc:60 src/typesoldz80.cc:61 -#: src/typesoldz80.cc:62 src/typesoldz80.cc:63 src/typesoldz80.cc:64 -#: src/typesoldz80.cc:65 src/typesoldz80.cc:67 src/typesoldz80.cc:68 -#: src/typesoldz80.cc:69 src/typesoldz80.cc:70 src/typesoldz80.cc:71 -#: src/typesoldz80.cc:72 src/typesoldz80.cc:73 src/typesoldz80.cc:74 -#: src/typesoldz80.cc:78 src/typesoldz80.cc:79 src/typesoldz80.cc:80 -#: src/typesoldz80.cc:81 src/typesoldz80.cc:82 src/typesoldz80.cc:83 -#: src/typesoldz80.cc:84 src/typesoldz80.cc:85 src/typesoldz80.cc:86 -#: src/typesoldz80.cc:87 src/typesoldz80.cc:97 src/typesoldz80.cc:102 -#: src/typesoldz80.cc:103 src/typesoldz80.cc:109 src/typesoldz80.cc:110 -#: src/typesoldz80.cc:111 src/typesoldz80.cc:112 src/typesoldz80.cc:113 -#: src/typesoldz80.cc:114 src/typesoldz80.cc:115 src/typesoldz80.cc:116 -#: src/typesoldz80.cc:117 src/typesoldz80.cc:118 src/typesoldz80.cc:119 -#: src/typesoldz80.cc:120 src/typesoldz80.cc:121 src/typesoldz80.cc:122 -#: src/typesoldz80.cc:123 src/typesoldz80.cc:124 src/typesoldz80.cc:125 -#: src/typesoldz80.cc:126 src/typesoldz80.cc:127 src/typesoldz80.cc:128 -#: src/typesoldz80.cc:129 src/typesoldz80.cc:130 src/typesoldz80.cc:131 -#: src/typesoldz80.cc:132 src/typesoldz80.cc:133 src/typesoldz80.cc:134 -#: src/typesoldz80.cc:135 src/typesoldz80.cc:136 src/typesoldz80.cc:137 -#: src/typesoldz80.cc:138 src/typesoldz80.cc:139 src/typesoldz80.cc:140 -#: src/typesoldz80.cc:155 src/typesoldz80.cc:156 src/typesoldz80.cc:157 -#: src/typesoldz80.cc:159 src/typesoldz80.cc:160 src/typesoldz80.cc:164 -#: src/typesoldz80.cc:166 src/typesoldz80.cc:167 src/typesoldz80.cc:168 -#: src/typesoldz80.cc:169 src/typesoldz80.cc:170 src/typesoldz80.cc:171 -#: src/typesoldz80.cc:172 src/typesoldz80.cc:173 src/typesoldz80.cc:174 -#: src/typesoldz80.cc:175 src/typesoldz80.cc:176 src/typesoldz80.cc:177 -#: src/typesoldz80.cc:178 src/typesoldz80.cc:179 src/typesoldz80.cc:180 -#: src/typesoldz80.cc:181 src/typesoldz80.cc:182 src/typesoldz80.cc:183 -#: src/typesoldz80.cc:184 src/typesoldz80.cc:185 src/typesoldz80.cc:186 -#: src/typesoldz80.cc:187 src/typesoldz80.cc:188 src/typesoldz80.cc:189 -#: src/typesoldz80.cc:190 src/typesoldz80.cc:191 src/typesoldz80.cc:192 -#: src/typesoldz80.cc:193 src/typesoldz80.cc:210 src/typesoldz80.cc:221 -#: src/typesoldz80.cc:227 src/typesoldz80.cc:229 src/typesoldz80.cc:230 -#: src/typesoldz80.cc:231 src/typesoldz80.cc:232 src/typesoldz80.cc:233 -#: src/typesoldz80.cc:234 src/typesoldz80.cc:235 src/typesoldz80.cc:236 -#: src/typesoldz80.cc:237 src/typesoldz80.cc:238 src/typesoldz80.cc:239 -#: src/typesoldz80.cc:240 src/typesoldz80.cc:242 src/typesoldz80.cc:243 -#: src/typesoldz80.cc:244 src/typesoldz80.cc:245 src/typesoldz80.cc:246 -#: src/typesoldz80.cc:263 src/typesoldz80.cc:274 src/typesoldz80.cc:280 -#: src/typesoldz80.cc:282 src/typesoldz80.cc:283 src/typesoldz80.cc:284 -#: src/typesoldz80.cc:285 src/typesoldz80.cc:286 src/typesoldz80.cc:287 -#: src/typesoldz80.cc:288 src/typesoldz80.cc:289 src/typesoldz80.cc:290 -#: src/typesoldz80.cc:291 src/typesoldz80.cc:292 src/typesoldz80.cc:293 -#: src/typesoldz80.cc:294 src/typesoldz80.cc:295 src/typesoldz80.cc:296 -#: src/typesoldz80.cc:297 src/typesoldz80.cc:298 src/typesoldz80.cc:299 +#: src/types83p.cc:53 src/types83p.cc:60 src/types83p.cc:69 src/types83p.cc:73 +#: src/types83p.cc:74 src/types83p.cc:75 src/types83p.cc:76 src/types83p.cc:77 +#: src/types83p.cc:78 src/types83p.cc:79 src/types83p.cc:80 src/types83p.cc:81 +#: src/types83p.cc:82 src/typesoldz80.cc:49 src/typesoldz80.cc:50 +#: src/typesoldz80.cc:53 src/typesoldz80.cc:54 src/typesoldz80.cc:58 +#: src/typesoldz80.cc:60 src/typesoldz80.cc:61 src/typesoldz80.cc:62 +#: src/typesoldz80.cc:63 src/typesoldz80.cc:64 src/typesoldz80.cc:65 +#: src/typesoldz80.cc:67 src/typesoldz80.cc:68 src/typesoldz80.cc:69 +#: src/typesoldz80.cc:70 src/typesoldz80.cc:71 src/typesoldz80.cc:72 +#: src/typesoldz80.cc:73 src/typesoldz80.cc:74 src/typesoldz80.cc:78 +#: src/typesoldz80.cc:79 src/typesoldz80.cc:80 src/typesoldz80.cc:81 +#: src/typesoldz80.cc:82 src/typesoldz80.cc:83 src/typesoldz80.cc:84 +#: src/typesoldz80.cc:85 src/typesoldz80.cc:86 src/typesoldz80.cc:87 +#: src/typesoldz80.cc:97 src/typesoldz80.cc:102 src/typesoldz80.cc:103 +#: src/typesoldz80.cc:109 src/typesoldz80.cc:110 src/typesoldz80.cc:111 +#: src/typesoldz80.cc:112 src/typesoldz80.cc:113 src/typesoldz80.cc:114 +#: src/typesoldz80.cc:115 src/typesoldz80.cc:116 src/typesoldz80.cc:117 +#: src/typesoldz80.cc:118 src/typesoldz80.cc:119 src/typesoldz80.cc:120 +#: src/typesoldz80.cc:121 src/typesoldz80.cc:122 src/typesoldz80.cc:123 +#: src/typesoldz80.cc:124 src/typesoldz80.cc:125 src/typesoldz80.cc:126 +#: src/typesoldz80.cc:127 src/typesoldz80.cc:128 src/typesoldz80.cc:129 +#: src/typesoldz80.cc:130 src/typesoldz80.cc:131 src/typesoldz80.cc:132 +#: src/typesoldz80.cc:133 src/typesoldz80.cc:134 src/typesoldz80.cc:135 +#: src/typesoldz80.cc:136 src/typesoldz80.cc:137 src/typesoldz80.cc:138 +#: src/typesoldz80.cc:139 src/typesoldz80.cc:140 src/typesoldz80.cc:155 +#: src/typesoldz80.cc:156 src/typesoldz80.cc:157 src/typesoldz80.cc:159 +#: src/typesoldz80.cc:160 src/typesoldz80.cc:164 src/typesoldz80.cc:166 +#: src/typesoldz80.cc:167 src/typesoldz80.cc:168 src/typesoldz80.cc:169 +#: src/typesoldz80.cc:170 src/typesoldz80.cc:171 src/typesoldz80.cc:172 +#: src/typesoldz80.cc:173 src/typesoldz80.cc:174 src/typesoldz80.cc:175 +#: src/typesoldz80.cc:176 src/typesoldz80.cc:177 src/typesoldz80.cc:178 +#: src/typesoldz80.cc:179 src/typesoldz80.cc:180 src/typesoldz80.cc:181 +#: src/typesoldz80.cc:182 src/typesoldz80.cc:183 src/typesoldz80.cc:184 +#: src/typesoldz80.cc:185 src/typesoldz80.cc:186 src/typesoldz80.cc:187 +#: src/typesoldz80.cc:188 src/typesoldz80.cc:189 src/typesoldz80.cc:190 +#: src/typesoldz80.cc:191 src/typesoldz80.cc:192 src/typesoldz80.cc:193 +#: src/typesoldz80.cc:210 src/typesoldz80.cc:221 src/typesoldz80.cc:227 +#: src/typesoldz80.cc:229 src/typesoldz80.cc:230 src/typesoldz80.cc:231 +#: src/typesoldz80.cc:232 src/typesoldz80.cc:233 src/typesoldz80.cc:234 +#: src/typesoldz80.cc:235 src/typesoldz80.cc:236 src/typesoldz80.cc:237 +#: src/typesoldz80.cc:238 src/typesoldz80.cc:239 src/typesoldz80.cc:240 +#: src/typesoldz80.cc:242 src/typesoldz80.cc:243 src/typesoldz80.cc:244 +#: src/typesoldz80.cc:245 src/typesoldz80.cc:246 src/typesoldz80.cc:263 +#: src/typesoldz80.cc:274 src/typesoldz80.cc:280 src/typesoldz80.cc:282 +#: src/typesoldz80.cc:283 src/typesoldz80.cc:284 src/typesoldz80.cc:285 +#: src/typesoldz80.cc:286 src/typesoldz80.cc:287 src/typesoldz80.cc:288 +#: src/typesoldz80.cc:289 src/typesoldz80.cc:290 src/typesoldz80.cc:291 +#: src/typesoldz80.cc:292 src/typesoldz80.cc:293 src/typesoldz80.cc:294 +#: src/typesoldz80.cc:295 src/typesoldz80.cc:296 src/typesoldz80.cc:297 +#: src/typesoldz80.cc:298 src/typesoldz80.cc:299 msgid "Unknown" msgstr "Unbekannt" @@ -367,6 +367,10 @@ msgstr "Zoom" msgid "Table Setup" msgstr "Tabellen Einstellungen" +#: src/types83p.cc:55 +msgid "App Obj" +msgstr "" + #: src/types83p.cc:56 src/typesoldz80.cc:66 msgid "App Var" msgstr "Anwendungsvariablen" diff --git a/libtifiles/trunk/po/fr.po b/libtifiles/trunk/po/fr.po index bc5f46ccc..27c3b5b5d 100644 --- a/libtifiles/trunk/po/fr.po +++ b/libtifiles/trunk/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: libtifiles2 1.1.8\n" "Report-Msgid-Bugs-To: tilp-users@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-10-21 21:38+0200\n" +"POT-Creation-Date: 2023-01-29 22:27+0100\n" "PO-Revision-Date: 2011-12-13 19:16+0100\n" "Last-Translator: Lionel Debroux \n" "Language-Team: Français \n" @@ -196,56 +196,56 @@ msgstr "Expression" #: src/types68k.cc:78 src/types68k.cc:79 src/types68k.cc:80 src/types68k.cc:81 #: src/types68k.cc:82 src/types68k.cc:83 src/types68k.cc:84 src/types68k.cc:85 #: src/types68k.cc:86 src/types83p.cc:44 src/types83p.cc:45 src/types83p.cc:49 -#: src/types83p.cc:53 src/types83p.cc:55 src/types83p.cc:60 src/types83p.cc:69 -#: src/types83p.cc:73 src/types83p.cc:74 src/types83p.cc:75 src/types83p.cc:76 -#: src/types83p.cc:77 src/types83p.cc:78 src/types83p.cc:79 src/types83p.cc:80 -#: src/types83p.cc:81 src/types83p.cc:82 src/typesoldz80.cc:49 -#: src/typesoldz80.cc:50 src/typesoldz80.cc:53 src/typesoldz80.cc:54 -#: src/typesoldz80.cc:58 src/typesoldz80.cc:60 src/typesoldz80.cc:61 -#: src/typesoldz80.cc:62 src/typesoldz80.cc:63 src/typesoldz80.cc:64 -#: src/typesoldz80.cc:65 src/typesoldz80.cc:67 src/typesoldz80.cc:68 -#: src/typesoldz80.cc:69 src/typesoldz80.cc:70 src/typesoldz80.cc:71 -#: src/typesoldz80.cc:72 src/typesoldz80.cc:73 src/typesoldz80.cc:74 -#: src/typesoldz80.cc:78 src/typesoldz80.cc:79 src/typesoldz80.cc:80 -#: src/typesoldz80.cc:81 src/typesoldz80.cc:82 src/typesoldz80.cc:83 -#: src/typesoldz80.cc:84 src/typesoldz80.cc:85 src/typesoldz80.cc:86 -#: src/typesoldz80.cc:87 src/typesoldz80.cc:97 src/typesoldz80.cc:102 -#: src/typesoldz80.cc:103 src/typesoldz80.cc:109 src/typesoldz80.cc:110 -#: src/typesoldz80.cc:111 src/typesoldz80.cc:112 src/typesoldz80.cc:113 -#: src/typesoldz80.cc:114 src/typesoldz80.cc:115 src/typesoldz80.cc:116 -#: src/typesoldz80.cc:117 src/typesoldz80.cc:118 src/typesoldz80.cc:119 -#: src/typesoldz80.cc:120 src/typesoldz80.cc:121 src/typesoldz80.cc:122 -#: src/typesoldz80.cc:123 src/typesoldz80.cc:124 src/typesoldz80.cc:125 -#: src/typesoldz80.cc:126 src/typesoldz80.cc:127 src/typesoldz80.cc:128 -#: src/typesoldz80.cc:129 src/typesoldz80.cc:130 src/typesoldz80.cc:131 -#: src/typesoldz80.cc:132 src/typesoldz80.cc:133 src/typesoldz80.cc:134 -#: src/typesoldz80.cc:135 src/typesoldz80.cc:136 src/typesoldz80.cc:137 -#: src/typesoldz80.cc:138 src/typesoldz80.cc:139 src/typesoldz80.cc:140 -#: src/typesoldz80.cc:155 src/typesoldz80.cc:156 src/typesoldz80.cc:157 -#: src/typesoldz80.cc:159 src/typesoldz80.cc:160 src/typesoldz80.cc:164 -#: src/typesoldz80.cc:166 src/typesoldz80.cc:167 src/typesoldz80.cc:168 -#: src/typesoldz80.cc:169 src/typesoldz80.cc:170 src/typesoldz80.cc:171 -#: src/typesoldz80.cc:172 src/typesoldz80.cc:173 src/typesoldz80.cc:174 -#: src/typesoldz80.cc:175 src/typesoldz80.cc:176 src/typesoldz80.cc:177 -#: src/typesoldz80.cc:178 src/typesoldz80.cc:179 src/typesoldz80.cc:180 -#: src/typesoldz80.cc:181 src/typesoldz80.cc:182 src/typesoldz80.cc:183 -#: src/typesoldz80.cc:184 src/typesoldz80.cc:185 src/typesoldz80.cc:186 -#: src/typesoldz80.cc:187 src/typesoldz80.cc:188 src/typesoldz80.cc:189 -#: src/typesoldz80.cc:190 src/typesoldz80.cc:191 src/typesoldz80.cc:192 -#: src/typesoldz80.cc:193 src/typesoldz80.cc:210 src/typesoldz80.cc:221 -#: src/typesoldz80.cc:227 src/typesoldz80.cc:229 src/typesoldz80.cc:230 -#: src/typesoldz80.cc:231 src/typesoldz80.cc:232 src/typesoldz80.cc:233 -#: src/typesoldz80.cc:234 src/typesoldz80.cc:235 src/typesoldz80.cc:236 -#: src/typesoldz80.cc:237 src/typesoldz80.cc:238 src/typesoldz80.cc:239 -#: src/typesoldz80.cc:240 src/typesoldz80.cc:242 src/typesoldz80.cc:243 -#: src/typesoldz80.cc:244 src/typesoldz80.cc:245 src/typesoldz80.cc:246 -#: src/typesoldz80.cc:263 src/typesoldz80.cc:274 src/typesoldz80.cc:280 -#: src/typesoldz80.cc:282 src/typesoldz80.cc:283 src/typesoldz80.cc:284 -#: src/typesoldz80.cc:285 src/typesoldz80.cc:286 src/typesoldz80.cc:287 -#: src/typesoldz80.cc:288 src/typesoldz80.cc:289 src/typesoldz80.cc:290 -#: src/typesoldz80.cc:291 src/typesoldz80.cc:292 src/typesoldz80.cc:293 -#: src/typesoldz80.cc:294 src/typesoldz80.cc:295 src/typesoldz80.cc:296 -#: src/typesoldz80.cc:297 src/typesoldz80.cc:298 src/typesoldz80.cc:299 +#: src/types83p.cc:53 src/types83p.cc:60 src/types83p.cc:69 src/types83p.cc:73 +#: src/types83p.cc:74 src/types83p.cc:75 src/types83p.cc:76 src/types83p.cc:77 +#: src/types83p.cc:78 src/types83p.cc:79 src/types83p.cc:80 src/types83p.cc:81 +#: src/types83p.cc:82 src/typesoldz80.cc:49 src/typesoldz80.cc:50 +#: src/typesoldz80.cc:53 src/typesoldz80.cc:54 src/typesoldz80.cc:58 +#: src/typesoldz80.cc:60 src/typesoldz80.cc:61 src/typesoldz80.cc:62 +#: src/typesoldz80.cc:63 src/typesoldz80.cc:64 src/typesoldz80.cc:65 +#: src/typesoldz80.cc:67 src/typesoldz80.cc:68 src/typesoldz80.cc:69 +#: src/typesoldz80.cc:70 src/typesoldz80.cc:71 src/typesoldz80.cc:72 +#: src/typesoldz80.cc:73 src/typesoldz80.cc:74 src/typesoldz80.cc:78 +#: src/typesoldz80.cc:79 src/typesoldz80.cc:80 src/typesoldz80.cc:81 +#: src/typesoldz80.cc:82 src/typesoldz80.cc:83 src/typesoldz80.cc:84 +#: src/typesoldz80.cc:85 src/typesoldz80.cc:86 src/typesoldz80.cc:87 +#: src/typesoldz80.cc:97 src/typesoldz80.cc:102 src/typesoldz80.cc:103 +#: src/typesoldz80.cc:109 src/typesoldz80.cc:110 src/typesoldz80.cc:111 +#: src/typesoldz80.cc:112 src/typesoldz80.cc:113 src/typesoldz80.cc:114 +#: src/typesoldz80.cc:115 src/typesoldz80.cc:116 src/typesoldz80.cc:117 +#: src/typesoldz80.cc:118 src/typesoldz80.cc:119 src/typesoldz80.cc:120 +#: src/typesoldz80.cc:121 src/typesoldz80.cc:122 src/typesoldz80.cc:123 +#: src/typesoldz80.cc:124 src/typesoldz80.cc:125 src/typesoldz80.cc:126 +#: src/typesoldz80.cc:127 src/typesoldz80.cc:128 src/typesoldz80.cc:129 +#: src/typesoldz80.cc:130 src/typesoldz80.cc:131 src/typesoldz80.cc:132 +#: src/typesoldz80.cc:133 src/typesoldz80.cc:134 src/typesoldz80.cc:135 +#: src/typesoldz80.cc:136 src/typesoldz80.cc:137 src/typesoldz80.cc:138 +#: src/typesoldz80.cc:139 src/typesoldz80.cc:140 src/typesoldz80.cc:155 +#: src/typesoldz80.cc:156 src/typesoldz80.cc:157 src/typesoldz80.cc:159 +#: src/typesoldz80.cc:160 src/typesoldz80.cc:164 src/typesoldz80.cc:166 +#: src/typesoldz80.cc:167 src/typesoldz80.cc:168 src/typesoldz80.cc:169 +#: src/typesoldz80.cc:170 src/typesoldz80.cc:171 src/typesoldz80.cc:172 +#: src/typesoldz80.cc:173 src/typesoldz80.cc:174 src/typesoldz80.cc:175 +#: src/typesoldz80.cc:176 src/typesoldz80.cc:177 src/typesoldz80.cc:178 +#: src/typesoldz80.cc:179 src/typesoldz80.cc:180 src/typesoldz80.cc:181 +#: src/typesoldz80.cc:182 src/typesoldz80.cc:183 src/typesoldz80.cc:184 +#: src/typesoldz80.cc:185 src/typesoldz80.cc:186 src/typesoldz80.cc:187 +#: src/typesoldz80.cc:188 src/typesoldz80.cc:189 src/typesoldz80.cc:190 +#: src/typesoldz80.cc:191 src/typesoldz80.cc:192 src/typesoldz80.cc:193 +#: src/typesoldz80.cc:210 src/typesoldz80.cc:221 src/typesoldz80.cc:227 +#: src/typesoldz80.cc:229 src/typesoldz80.cc:230 src/typesoldz80.cc:231 +#: src/typesoldz80.cc:232 src/typesoldz80.cc:233 src/typesoldz80.cc:234 +#: src/typesoldz80.cc:235 src/typesoldz80.cc:236 src/typesoldz80.cc:237 +#: src/typesoldz80.cc:238 src/typesoldz80.cc:239 src/typesoldz80.cc:240 +#: src/typesoldz80.cc:242 src/typesoldz80.cc:243 src/typesoldz80.cc:244 +#: src/typesoldz80.cc:245 src/typesoldz80.cc:246 src/typesoldz80.cc:263 +#: src/typesoldz80.cc:274 src/typesoldz80.cc:280 src/typesoldz80.cc:282 +#: src/typesoldz80.cc:283 src/typesoldz80.cc:284 src/typesoldz80.cc:285 +#: src/typesoldz80.cc:286 src/typesoldz80.cc:287 src/typesoldz80.cc:288 +#: src/typesoldz80.cc:289 src/typesoldz80.cc:290 src/typesoldz80.cc:291 +#: src/typesoldz80.cc:292 src/typesoldz80.cc:293 src/typesoldz80.cc:294 +#: src/typesoldz80.cc:295 src/typesoldz80.cc:296 src/typesoldz80.cc:297 +#: src/typesoldz80.cc:298 src/typesoldz80.cc:299 msgid "Unknown" msgstr "Inconnu" @@ -367,6 +367,10 @@ msgstr "Zoom" msgid "Table Setup" msgstr "Config Table" +#: src/types83p.cc:55 +msgid "App Obj" +msgstr "Objet Application" + #: src/types83p.cc:56 src/typesoldz80.cc:66 msgid "App Var" msgstr "Variable Application" diff --git a/libtifiles/trunk/po/libtifiles2.pot b/libtifiles/trunk/po/libtifiles2.pot index 7f69227cc..6142dfd49 100644 --- a/libtifiles/trunk/po/libtifiles2.pot +++ b/libtifiles/trunk/po/libtifiles2.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: libtifiles2 1.1.8\n" "Report-Msgid-Bugs-To: tilp-users@lists.sourceforge.net\n" -"POT-Creation-Date: 2018-10-21 21:38+0200\n" +"POT-Creation-Date: 2023-01-29 22:27+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -188,56 +188,56 @@ msgstr "" #: src/types68k.cc:78 src/types68k.cc:79 src/types68k.cc:80 src/types68k.cc:81 #: src/types68k.cc:82 src/types68k.cc:83 src/types68k.cc:84 src/types68k.cc:85 #: src/types68k.cc:86 src/types83p.cc:44 src/types83p.cc:45 src/types83p.cc:49 -#: src/types83p.cc:53 src/types83p.cc:55 src/types83p.cc:60 src/types83p.cc:69 -#: src/types83p.cc:73 src/types83p.cc:74 src/types83p.cc:75 src/types83p.cc:76 -#: src/types83p.cc:77 src/types83p.cc:78 src/types83p.cc:79 src/types83p.cc:80 -#: src/types83p.cc:81 src/types83p.cc:82 src/typesoldz80.cc:49 -#: src/typesoldz80.cc:50 src/typesoldz80.cc:53 src/typesoldz80.cc:54 -#: src/typesoldz80.cc:58 src/typesoldz80.cc:60 src/typesoldz80.cc:61 -#: src/typesoldz80.cc:62 src/typesoldz80.cc:63 src/typesoldz80.cc:64 -#: src/typesoldz80.cc:65 src/typesoldz80.cc:67 src/typesoldz80.cc:68 -#: src/typesoldz80.cc:69 src/typesoldz80.cc:70 src/typesoldz80.cc:71 -#: src/typesoldz80.cc:72 src/typesoldz80.cc:73 src/typesoldz80.cc:74 -#: src/typesoldz80.cc:78 src/typesoldz80.cc:79 src/typesoldz80.cc:80 -#: src/typesoldz80.cc:81 src/typesoldz80.cc:82 src/typesoldz80.cc:83 -#: src/typesoldz80.cc:84 src/typesoldz80.cc:85 src/typesoldz80.cc:86 -#: src/typesoldz80.cc:87 src/typesoldz80.cc:97 src/typesoldz80.cc:102 -#: src/typesoldz80.cc:103 src/typesoldz80.cc:109 src/typesoldz80.cc:110 -#: src/typesoldz80.cc:111 src/typesoldz80.cc:112 src/typesoldz80.cc:113 -#: src/typesoldz80.cc:114 src/typesoldz80.cc:115 src/typesoldz80.cc:116 -#: src/typesoldz80.cc:117 src/typesoldz80.cc:118 src/typesoldz80.cc:119 -#: src/typesoldz80.cc:120 src/typesoldz80.cc:121 src/typesoldz80.cc:122 -#: src/typesoldz80.cc:123 src/typesoldz80.cc:124 src/typesoldz80.cc:125 -#: src/typesoldz80.cc:126 src/typesoldz80.cc:127 src/typesoldz80.cc:128 -#: src/typesoldz80.cc:129 src/typesoldz80.cc:130 src/typesoldz80.cc:131 -#: src/typesoldz80.cc:132 src/typesoldz80.cc:133 src/typesoldz80.cc:134 -#: src/typesoldz80.cc:135 src/typesoldz80.cc:136 src/typesoldz80.cc:137 -#: src/typesoldz80.cc:138 src/typesoldz80.cc:139 src/typesoldz80.cc:140 -#: src/typesoldz80.cc:155 src/typesoldz80.cc:156 src/typesoldz80.cc:157 -#: src/typesoldz80.cc:159 src/typesoldz80.cc:160 src/typesoldz80.cc:164 -#: src/typesoldz80.cc:166 src/typesoldz80.cc:167 src/typesoldz80.cc:168 -#: src/typesoldz80.cc:169 src/typesoldz80.cc:170 src/typesoldz80.cc:171 -#: src/typesoldz80.cc:172 src/typesoldz80.cc:173 src/typesoldz80.cc:174 -#: src/typesoldz80.cc:175 src/typesoldz80.cc:176 src/typesoldz80.cc:177 -#: src/typesoldz80.cc:178 src/typesoldz80.cc:179 src/typesoldz80.cc:180 -#: src/typesoldz80.cc:181 src/typesoldz80.cc:182 src/typesoldz80.cc:183 -#: src/typesoldz80.cc:184 src/typesoldz80.cc:185 src/typesoldz80.cc:186 -#: src/typesoldz80.cc:187 src/typesoldz80.cc:188 src/typesoldz80.cc:189 -#: src/typesoldz80.cc:190 src/typesoldz80.cc:191 src/typesoldz80.cc:192 -#: src/typesoldz80.cc:193 src/typesoldz80.cc:210 src/typesoldz80.cc:221 -#: src/typesoldz80.cc:227 src/typesoldz80.cc:229 src/typesoldz80.cc:230 -#: src/typesoldz80.cc:231 src/typesoldz80.cc:232 src/typesoldz80.cc:233 -#: src/typesoldz80.cc:234 src/typesoldz80.cc:235 src/typesoldz80.cc:236 -#: src/typesoldz80.cc:237 src/typesoldz80.cc:238 src/typesoldz80.cc:239 -#: src/typesoldz80.cc:240 src/typesoldz80.cc:242 src/typesoldz80.cc:243 -#: src/typesoldz80.cc:244 src/typesoldz80.cc:245 src/typesoldz80.cc:246 -#: src/typesoldz80.cc:263 src/typesoldz80.cc:274 src/typesoldz80.cc:280 -#: src/typesoldz80.cc:282 src/typesoldz80.cc:283 src/typesoldz80.cc:284 -#: src/typesoldz80.cc:285 src/typesoldz80.cc:286 src/typesoldz80.cc:287 -#: src/typesoldz80.cc:288 src/typesoldz80.cc:289 src/typesoldz80.cc:290 -#: src/typesoldz80.cc:291 src/typesoldz80.cc:292 src/typesoldz80.cc:293 -#: src/typesoldz80.cc:294 src/typesoldz80.cc:295 src/typesoldz80.cc:296 -#: src/typesoldz80.cc:297 src/typesoldz80.cc:298 src/typesoldz80.cc:299 +#: src/types83p.cc:53 src/types83p.cc:60 src/types83p.cc:69 src/types83p.cc:73 +#: src/types83p.cc:74 src/types83p.cc:75 src/types83p.cc:76 src/types83p.cc:77 +#: src/types83p.cc:78 src/types83p.cc:79 src/types83p.cc:80 src/types83p.cc:81 +#: src/types83p.cc:82 src/typesoldz80.cc:49 src/typesoldz80.cc:50 +#: src/typesoldz80.cc:53 src/typesoldz80.cc:54 src/typesoldz80.cc:58 +#: src/typesoldz80.cc:60 src/typesoldz80.cc:61 src/typesoldz80.cc:62 +#: src/typesoldz80.cc:63 src/typesoldz80.cc:64 src/typesoldz80.cc:65 +#: src/typesoldz80.cc:67 src/typesoldz80.cc:68 src/typesoldz80.cc:69 +#: src/typesoldz80.cc:70 src/typesoldz80.cc:71 src/typesoldz80.cc:72 +#: src/typesoldz80.cc:73 src/typesoldz80.cc:74 src/typesoldz80.cc:78 +#: src/typesoldz80.cc:79 src/typesoldz80.cc:80 src/typesoldz80.cc:81 +#: src/typesoldz80.cc:82 src/typesoldz80.cc:83 src/typesoldz80.cc:84 +#: src/typesoldz80.cc:85 src/typesoldz80.cc:86 src/typesoldz80.cc:87 +#: src/typesoldz80.cc:97 src/typesoldz80.cc:102 src/typesoldz80.cc:103 +#: src/typesoldz80.cc:109 src/typesoldz80.cc:110 src/typesoldz80.cc:111 +#: src/typesoldz80.cc:112 src/typesoldz80.cc:113 src/typesoldz80.cc:114 +#: src/typesoldz80.cc:115 src/typesoldz80.cc:116 src/typesoldz80.cc:117 +#: src/typesoldz80.cc:118 src/typesoldz80.cc:119 src/typesoldz80.cc:120 +#: src/typesoldz80.cc:121 src/typesoldz80.cc:122 src/typesoldz80.cc:123 +#: src/typesoldz80.cc:124 src/typesoldz80.cc:125 src/typesoldz80.cc:126 +#: src/typesoldz80.cc:127 src/typesoldz80.cc:128 src/typesoldz80.cc:129 +#: src/typesoldz80.cc:130 src/typesoldz80.cc:131 src/typesoldz80.cc:132 +#: src/typesoldz80.cc:133 src/typesoldz80.cc:134 src/typesoldz80.cc:135 +#: src/typesoldz80.cc:136 src/typesoldz80.cc:137 src/typesoldz80.cc:138 +#: src/typesoldz80.cc:139 src/typesoldz80.cc:140 src/typesoldz80.cc:155 +#: src/typesoldz80.cc:156 src/typesoldz80.cc:157 src/typesoldz80.cc:159 +#: src/typesoldz80.cc:160 src/typesoldz80.cc:164 src/typesoldz80.cc:166 +#: src/typesoldz80.cc:167 src/typesoldz80.cc:168 src/typesoldz80.cc:169 +#: src/typesoldz80.cc:170 src/typesoldz80.cc:171 src/typesoldz80.cc:172 +#: src/typesoldz80.cc:173 src/typesoldz80.cc:174 src/typesoldz80.cc:175 +#: src/typesoldz80.cc:176 src/typesoldz80.cc:177 src/typesoldz80.cc:178 +#: src/typesoldz80.cc:179 src/typesoldz80.cc:180 src/typesoldz80.cc:181 +#: src/typesoldz80.cc:182 src/typesoldz80.cc:183 src/typesoldz80.cc:184 +#: src/typesoldz80.cc:185 src/typesoldz80.cc:186 src/typesoldz80.cc:187 +#: src/typesoldz80.cc:188 src/typesoldz80.cc:189 src/typesoldz80.cc:190 +#: src/typesoldz80.cc:191 src/typesoldz80.cc:192 src/typesoldz80.cc:193 +#: src/typesoldz80.cc:210 src/typesoldz80.cc:221 src/typesoldz80.cc:227 +#: src/typesoldz80.cc:229 src/typesoldz80.cc:230 src/typesoldz80.cc:231 +#: src/typesoldz80.cc:232 src/typesoldz80.cc:233 src/typesoldz80.cc:234 +#: src/typesoldz80.cc:235 src/typesoldz80.cc:236 src/typesoldz80.cc:237 +#: src/typesoldz80.cc:238 src/typesoldz80.cc:239 src/typesoldz80.cc:240 +#: src/typesoldz80.cc:242 src/typesoldz80.cc:243 src/typesoldz80.cc:244 +#: src/typesoldz80.cc:245 src/typesoldz80.cc:246 src/typesoldz80.cc:263 +#: src/typesoldz80.cc:274 src/typesoldz80.cc:280 src/typesoldz80.cc:282 +#: src/typesoldz80.cc:283 src/typesoldz80.cc:284 src/typesoldz80.cc:285 +#: src/typesoldz80.cc:286 src/typesoldz80.cc:287 src/typesoldz80.cc:288 +#: src/typesoldz80.cc:289 src/typesoldz80.cc:290 src/typesoldz80.cc:291 +#: src/typesoldz80.cc:292 src/typesoldz80.cc:293 src/typesoldz80.cc:294 +#: src/typesoldz80.cc:295 src/typesoldz80.cc:296 src/typesoldz80.cc:297 +#: src/typesoldz80.cc:298 src/typesoldz80.cc:299 msgid "Unknown" msgstr "" @@ -359,6 +359,10 @@ msgstr "" msgid "Table Setup" msgstr "" +#: src/types83p.cc:55 +msgid "App Obj" +msgstr "" + #: src/types83p.cc:56 src/typesoldz80.cc:66 msgid "App Var" msgstr "" diff --git a/libtifiles/trunk/src/types83p.cc b/libtifiles/trunk/src/types83p.cc index 56c58346b..27d0aba51 100644 --- a/libtifiles/trunk/src/types83p.cc +++ b/libtifiles/trunk/src/types83p.cc @@ -52,9 +52,9 @@ const TI83p_DATA TI83p_CONST[TI83p_MAXTYPES + 1] = {"TABLE", "8Xt", "8Xt", "8Xt", "8Xt", "8Xt", "8Xt", "Table Setup", N_("Table Setup")}, {"", "8X?", "8X?", "8X?", "8X?", "8X?", "8X?", "Unknown", N_("Unknown")}, {"BKUP", "8Xb", "8Xb", "8Xb", "8Xb", "8Xb", "8Xb", "Backup", N_("Backup")}, - {"", "8X?", "8X?", "8X?", "8X?", "8X?", "8X?", "Unknown", N_("Unknown")}, // 20, 0x14 + {"APPOBJ", "8Xv", "8Xv", "8Xv", "8Xv", "8Xv", "8Xv", "Unknown", N_("App Obj")}, /* AppObj */ // 20, 0x14 {"APPV", "8Xv", "8Xv", "8Xv", "8Xv", "8Xv", "8Xv", "App Var", N_("App Var")}, - {"TPRGM", "8Xp", "8Xp", "8Xp", "8Xp", "8Xp", "8Xp", "Program", N_("Program")}, /* TempProg */ + {"TPRGM", "8Xp", "8Xp", "8Xp", "8Xp", "8Xp", "8Xp", "Program", N_("Program")}, /* TempProgObj */ {"GRP", "8Xo", "8Xo", "8Xo", "8Xo", "8Xo", "8Xo", "Group Var", N_("Group Var")}, // Also 8Xg {"REAL", "8Xn", "8Xn", "8Xn", "8Xn", "8Xn", "8Xn", "Real", N_("Real")}, /* Fraction */ {"DIR", "8X?", "8X?", "8X?", "8X?", "8X?", "8X?", "Unknown", N_("Unknown")}, // 25, 0x19 diff --git a/libtifiles/trunk/src/types83p.h b/libtifiles/trunk/src/types83p.h index 0d2c0dcbc..c587f0652 100644 --- a/libtifiles/trunk/src/types83p.h +++ b/libtifiles/trunk/src/types83p.h @@ -44,8 +44,10 @@ #define TI83p_TAB 0x11 //deprecated #define TI83p_TABLE 0x11 #define TI83p_BKUP 0x13 +#define TI83p_APPOBJ 0x14 #define TI83p_APPVAR 0x15 //deprecated #define TI83p_APPV 0x15 +#define TI83p_TEMPPROGOBJ 0x16 #define TI83p_GRP 0x17 #define TI83p_DIR 0x19 #define TI83p_AMS 0x23 diff --git a/libtifiles/trunk/src/types84p.h b/libtifiles/trunk/src/types84p.h index e7d5315dd..8ced576bf 100644 --- a/libtifiles/trunk/src/types84p.h +++ b/libtifiles/trunk/src/types84p.h @@ -49,8 +49,10 @@ #define TI84p_TAB 0x11 //deprecated #define TI84p_TABLE 0x11 #define TI84p_BKUP 0x13 +#define TI84p_APPOBJ 0x14 #define TI84p_APPVAR 0x15 //deprecated #define TI84p_APPV 0x15 +#define TI84p_TEMPPROGOBJ 0x16 #define TI84p_GROUP 0x17 #define TI83pce_SIMPLEFRAC 0x18 #define TI84p_DIR 0x19 diff --git a/libtifiles/trunk/src/types89.h b/libtifiles/trunk/src/types89.h index 983678ae5..a15c9b128 100644 --- a/libtifiles/trunk/src/types89.h +++ b/libtifiles/trunk/src/types89.h @@ -26,35 +26,36 @@ #define TI89_MAXTYPES 48 -#define TI89_EXPR 0x00 -#define TI89_LIST 0x04 -#define TI89_MAT 0x06 -#define TI89_DATA 0x0A -#define TI89_TEXT 0x0B -#define TI89_STR 0x0C -#define TI89_GDB 0x0D -#define TI89_FIG 0x0E -#define TI89_PIC 0x10 -#define TI89_PRGM 0x12 -#define TI89_FUNC 0x13 -#define TI89_MAC 0x14 -#define TI89_CLK 0x18 // clock -#define TI89_RDIR 0x1A // request -#define TI89_LDIR 0x1B // local -#define TI89_ZIP 0x1C -#define TI89_BKUP 0x1D -#define TI89_FDIR 0x1F // full -#define TI89_DIR TI89_FDIR //type -#define TI89_GETCERT 0x20 -#define TI89_ASM 0x21 -#define TI89_IDLIST 0x22 -#define TI89_AMS 0x23 -#define TI89_APPL 0x24 -#define TI89_CERTIF 0x25 -#define TI89_LICENSE 0x3E +#define TI89_EXPR 0x00 +#define TI89_LIST 0x04 +#define TI89_MAT 0x06 +#define TI89_DATA 0x0A +#define TI89_TEXT 0x0B +#define TI89_STR 0x0C +#define TI89_GDB 0x0D +#define TI89_FIG 0x0E +#define TI89_PIC 0x10 +#define TI89_PRGM 0x12 +#define TI89_FUNC 0x13 +#define TI89_MAC 0x14 +#define TI89_CLK 0x18 // clock +#define TI89_RDIR 0x1A // request +#define TI89_LDIR 0x1B // local +#define TI89_OTH 0x1C +#define TI89_ZIP 0x1C // for backwards compatibility +#define TI89_BKUP 0x1D +#define TI89_FDIR 0x1F // full +#define TI89_DIR TI89_FDIR // type +#define TI89_GETCERT 0x20 +#define TI89_ASM 0x21 +#define TI89_IDLIST 0x22 +#define TI89_AMS 0x23 +#define TI89_APPL 0x24 +#define TI89_CERTIF 0x25 +#define TI89_LICENSE 0x3E -#define TI89_VNONE 0 -#define TI89_VLOCK 1 -#define TI89_VARCH 3 +#define TI89_VNONE 0 +#define TI89_VLOCK 1 +#define TI89_VARCH 3 #endif diff --git a/libtifiles/trunk/src/types89t.h b/libtifiles/trunk/src/types89t.h index 9b2c9f560..40d1fa6bc 100644 --- a/libtifiles/trunk/src/types89t.h +++ b/libtifiles/trunk/src/types89t.h @@ -25,35 +25,36 @@ #define TI89t_MAXTYPES 48 -#define TI89t_EXPR 0x00 -#define TI89t_LIST 0x04 -#define TI89t_MAT 0x06 -#define TI89t_DATA 0x0A -#define TI89t_TEXT 0x0B -#define TI89t_STR 0x0C -#define TI89t_GDB 0x0D -#define TI89t_FIG 0x0E -#define TI89t_PIC 0x10 -#define TI89t_PRGM 0x12 -#define TI89t_FUNC 0x13 -#define TI89t_MAC 0x14 -#define TI89t_CLK 0x18 // clock -#define TI89t_RDIR 0x1A // request -#define TI89t_LDIR 0x1B // local -#define TI89t_STDY 0x1C -#define TI89t_BKUP 0x1D -#define TI89t_FDIR 0x1F // full -#define TI89t_DIR TI89t_FDIR //type +#define TI89t_EXPR 0x00 +#define TI89t_LIST 0x04 +#define TI89t_MAT 0x06 +#define TI89t_DATA 0x0A +#define TI89t_TEXT 0x0B +#define TI89t_STR 0x0C +#define TI89t_GDB 0x0D +#define TI89t_FIG 0x0E +#define TI89t_PIC 0x10 +#define TI89t_PRGM 0x12 +#define TI89t_FUNC 0x13 +#define TI89t_MAC 0x14 +#define TI89t_CLK 0x18 // clock +#define TI89t_RDIR 0x1A // request +#define TI89t_LDIR 0x1B // local +#define TI89t_OTH 0x1C +#define TI89t_STDY 0x1C // for backwards compatibility +#define TI89t_BKUP 0x1D +#define TI89t_FDIR 0x1F // full +#define TI89t_DIR TI89t_FDIR // type #define TI89r_GETCERT 0x20 -#define TI89t_ASM 0x21 +#define TI89t_ASM 0x21 #define TI89t_IDLIST 0x22 #define TI89t_AMS 0x23 #define TI89t_APPL 0x24 #define TI89t_CERTIF 0x25 #define TI89t_LICENSE 0x3E -#define TI89t_VNONE 0 -#define TI89t_VLOCK 1 -#define TI89t_VARCH 3 +#define TI89t_VNONE 0 +#define TI89t_VLOCK 1 +#define TI89t_VARCH 3 #endif diff --git a/libtifiles/trunk/src/types92.h b/libtifiles/trunk/src/types92.h index ff10b8afc..72b8f128d 100644 --- a/libtifiles/trunk/src/types92.h +++ b/libtifiles/trunk/src/types92.h @@ -26,21 +26,21 @@ #define TI92_MAXTYPES 48 -#define TI92_EXPR 0x00 -#define TI92_LIST 0x04 -#define TI92_MAT 0x06 -#define TI92_DATA 0x0A -#define TI92_TEXT 0x0B -#define TI92_STR 0x0C -#define TI92_GDB 0x0D -#define TI92_FIG 0x0E -#define TI92_PIC 0x10 -#define TI92_PRGM 0x12 -#define TI92_FUNC 0x13 -#define TI92_MAC 0x14 -#define TI92_RDIR 0x19 -#define TI92_BKUP 0x1D -#define TI92_DIR 0x1F +#define TI92_EXPR 0x00 +#define TI92_LIST 0x04 +#define TI92_MAT 0x06 +#define TI92_DATA 0x0A +#define TI92_TEXT 0x0B +#define TI92_STR 0x0C +#define TI92_GDB 0x0D +#define TI92_FIG 0x0E +#define TI92_PIC 0x10 +#define TI92_PRGM 0x12 +#define TI92_FUNC 0x13 +#define TI92_MAC 0x14 +#define TI92_RDIR 0x19 +#define TI92_BKUP 0x1D +#define TI92_DIR 0x1F #define TI92_VNONE 0 #define TI92_VLOCK 1 diff --git a/libtifiles/trunk/src/types92p.h b/libtifiles/trunk/src/types92p.h index 0101a9967..c6677166c 100644 --- a/libtifiles/trunk/src/types92p.h +++ b/libtifiles/trunk/src/types92p.h @@ -26,35 +26,36 @@ #define TI92p_MAXTYPES 48 -#define TI92p_EXPR 0x00 -#define TI92p_LIST 0x04 -#define TI92p_MAT 0x06 -#define TI92p_DATA 0x0A -#define TI92p_TEXT 0x0B -#define TI92p_STR 0x0C -#define TI92p_GDB 0x0D -#define TI92p_FIG 0x0E -#define TI92p_PIC 0x10 -#define TI92p_PRGM 0x12 -#define TI92p_FUNC 0x13 -#define TI92p_MAC 0x14 -#define TI92p_CLK 0x18 -#define TI92p_RDIR 0x1A -#define TI92p_LDIR 0x1B -#define TI92p_ZIP 0x1C -#define TI92p_BKUP 0x1D -#define TI92p_FDIR 0x1F -#define TI92p_DIR TI92p_FDIR +#define TI92p_EXPR 0x00 +#define TI92p_LIST 0x04 +#define TI92p_MAT 0x06 +#define TI92p_DATA 0x0A +#define TI92p_TEXT 0x0B +#define TI92p_STR 0x0C +#define TI92p_GDB 0x0D +#define TI92p_FIG 0x0E +#define TI92p_PIC 0x10 +#define TI92p_PRGM 0x12 +#define TI92p_FUNC 0x13 +#define TI92p_MAC 0x14 +#define TI92p_CLK 0x18 // clock +#define TI92p_RDIR 0x1A // request +#define TI92p_LDIR 0x1B // local +#define TI92p_OTH 0x1C +#define TI92p_ZIP 0x1C // for backwards compatibility +#define TI92p_BKUP 0x1D +#define TI92p_FDIR 0x1F // full +#define TI92p_DIR TI92p_FDIR // type #define TI92p_GETCERT 0x20 -#define TI92p_ASM 0x21 +#define TI92p_ASM 0x21 #define TI92p_IDLIST 0x22 #define TI92p_AMS 0x23 #define TI92p_APPL 0x24 #define TI92p_CERTIF 0x25 #define TI92p_LICENSE 0x3E -#define TI92p_VNONE 0 -#define TI92p_VLOCK 1 -#define TI92p_VARCH 3 +#define TI92p_VNONE 0 +#define TI92p_VLOCK 1 +#define TI92p_VARCH 3 #endif diff --git a/libtifiles/trunk/src/typesv2.h b/libtifiles/trunk/src/typesv2.h index 1a149ad35..77a6a20a9 100644 --- a/libtifiles/trunk/src/typesv2.h +++ b/libtifiles/trunk/src/typesv2.h @@ -26,35 +26,36 @@ #define V200_MAXTYPES 48 -#define V200_EXPR 0x00 -#define V200_LIST 0x04 -#define V200_MAT 0x06 -#define V200_DATA 0x0A -#define V200_TEXT 0x0B -#define V200_STR 0x0C -#define V200_GDB 0x0D -#define V200_FIG 0x0E -#define V200_PIC 0x10 -#define V200_PRGM 0x12 -#define V200_FUNC 0x13 -#define V200_MAC 0x14 -#define V200_CLK 0x18 -#define V200_RDIR 0x1A // request -#define V200_LDIR 0x1B // local -#define V200_ZIP 0x1C -#define V200_BKUP 0x1D -#define V200_FDIR 0x1F // full -#define V200_DIR V200_FDIR //type -#define V200_GETCERT 0x20 -#define V200_ASM 0x21 -#define V200_IDLIST 0x22 -#define V200_AMS 0x23 -#define V200_APPL 0x24 -#define V200_CERTIF 0x25 -#define V200_LICENSE 0x3E +#define V200_EXPR 0x00 +#define V200_LIST 0x04 +#define V200_MAT 0x06 +#define V200_DATA 0x0A +#define V200_TEXT 0x0B +#define V200_STR 0x0C +#define V200_GDB 0x0D +#define V200_FIG 0x0E +#define V200_PIC 0x10 +#define V200_PRGM 0x12 +#define V200_FUNC 0x13 +#define V200_MAC 0x14 +#define V200_CLK 0x18 // clock +#define V200_RDIR 0x1A // request +#define V200_LDIR 0x1B // local +#define V200_OTH 0x1C +#define V200_ZIP 0x1C // for backwards compatibility +#define V200_BKUP 0x1D +#define V200_FDIR 0x1F // full +#define V200_DIR V200_FDIR // type +#define V200_GETCERT 0x20 +#define V200_ASM 0x21 +#define V200_IDLIST 0x22 +#define V200_AMS 0x23 +#define V200_APPL 0x24 +#define V200_CERTIF 0x25 +#define V200_LICENSE 0x3E -#define V200_VNONE 0 -#define V200_VLOCK 1 -#define V200_VARCH 3 +#define V200_VNONE 0 +#define V200_VLOCK 1 +#define V200_VARCH 3 #endif diff --git a/tifileutil/AUTHORS b/tifileutil/AUTHORS new file mode 100644 index 000000000..4765bc044 --- /dev/null +++ b/tifileutil/AUTHORS @@ -0,0 +1,22 @@ +Lionel Debroux: maintainer (2009-): tifileutil +============================================== + +web: http://lpg.ticalc.org/prj_tilp , http://tict.ticalc.org , https://tiplanet.org +mail: lionel_debroux@yahoo.fr + +Benjamin Moody (FloppusMaximus): tipack, etc. +============================================= + +web: http://lpg.ticalc.org/prj_tilem/index.html +mail: benjamin.moody@gmail.com + +Romain Liévin (roms): former maintainer (1999-2009), tf2hex +=========================================================== + +web: http://lpg.ticalc.org/prj_tilp +mail: roms@tilp.info + +Jon Sturm (Jonimus): titools +============================ + +mail: jonimoose@gmail.com diff --git a/tifileutil/CMakeLists.txt b/tifileutil/CMakeLists.txt new file mode 100644 index 000000000..1f5738142 --- /dev/null +++ b/tifileutil/CMakeLists.txt @@ -0,0 +1,66 @@ +cmake_minimum_required(VERSION 3.12) + +project(tifileutil + VERSION 0.1 + LANGUAGES CXX) + +set(HEADER_FILES + src/gettext.h + src/logging.h) +set(SRC_FILES + ${HEADER_FILES} + src/main.cc) + +# external deps lookup +pkg_check_modules(DEPS REQUIRED glib-2.0 libarchive zlib) +add_executable(tifileutil ${SRC_FILES}) + +try_static_libs_if_needed() + +target_compile_options(tifileutil PRIVATE ${DEPS_CFLAGS}) + +add_compile_definitions(tifileutil PACKAGE="TIFILEUTIL" PACKAGE_VERSION="0.1") + +# internal deps +target_include_directories(tifileutil PRIVATE + ${CMAKE_SOURCE_DIR}/libticonv/trunk/src + ${CMAKE_SOURCE_DIR}/libtifiles/trunk/src) + +# Link-related properties, flags... +if(TRY_STATIC_LIBS) + add_dependencies(tifileutil ticonv_static tifiles2_static) + target_link_libraries(tifileutil ${TRY_STATIC_DEPS_LDFLAGS} ticonv_static tifiles2_static) + if(Iconv_FOUND AND NOT Iconv_IS_BUILT_IN) + target_include_directories(tifileutil PRIVATE ${Iconv_INCLUDE_DIRS}) + if(Iconv_LIBRARY_DIRS) + target_link_directories(tifileutil PRIVATE ${Iconv_LIBRARY_DIRS}) + endif() + target_link_libraries(tifileutil ${Iconv_LIBRARIES}) + endif() + if(LINUX) + target_link_libraries(tifileutil ${CMAKE_DL_LIBS} -static-libgcc -static-libstdc++) + endif() +else() + add_dependencies(tifileutil ticonv_shared tifiles2_shared) + target_link_directories(tifileutil PRIVATE + ${DEPS_LIBRARY_DIRS} + ${CMAKE_BINARY_DIR}/libticonv/trunk + ${CMAKE_BINARY_DIR}/libtifiles/trunk) + target_link_libraries(tifileutil ${DEPS_LIBRARIES} ticonv_shared tifiles2_shared) +endif() + +# Takes care of the i18n po/pot/gmo/mo files +if(ENABLE_NLS) + i18n_mo_from_po_pot() + if(TARGET potfiles_1) + add_dependencies(tifileutil potfiles_1) + else() + message(WARNING "tifileutil target potfiles_1 (i18n) is not available - did you run intltool-update?") + remove_definitions(-DENABLE_NLS) + endif() +endif() + +# Install rules +install(TARGETS tifileutil + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/tifileutil/COPYING b/tifileutil/COPYING new file mode 100644 index 000000000..d159169d1 --- /dev/null +++ b/tifileutil/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/tifileutil/ChangeLog b/tifileutil/ChangeLog new file mode 100644 index 000000000..e69de29bb diff --git a/tifileutil/Makefile.am b/tifileutil/Makefile.am new file mode 100644 index 000000000..746895514 --- /dev/null +++ b/tifileutil/Makefile.am @@ -0,0 +1,18 @@ +## Process this file with automake to produce Makefile.in + +ACLOCAL_AMFLAGS=-I m4 + +# subdirectories to scan +SUBDIRS = build po src + +if USE_GROFF + SUBDIRS += man +endif + +dist_pkgdata_DATA = COPYING RELEASE + +DISTCLEANFILES = ... intltool-extract intltool-merge intltool-update po/.intltool-merge-cache + +EXTRA_DIST = README.* TODO + +INTLTOOL_FILES = intltool-extract.in intltool-merge.in intltool-update.in diff --git a/tifileutil/NEWS b/tifileutil/NEWS new file mode 100644 index 000000000..e69de29bb diff --git a/tifileutil/README b/tifileutil/README new file mode 100644 index 000000000..e69de29bb diff --git a/tifileutil/RELEASE b/tifileutil/RELEASE new file mode 100644 index 000000000..e69de29bb diff --git a/tifileutil/build/Makefile.am b/tifileutil/build/Makefile.am new file mode 100644 index 000000000..764db6345 --- /dev/null +++ b/tifileutil/build/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS = mingw +EXTRA_DIST = mingw diff --git a/tifileutil/build/mingw/Makefile.am b/tifileutil/build/mingw/Makefile.am new file mode 100644 index 000000000..a59b7b1bc --- /dev/null +++ b/tifileutil/build/mingw/Makefile.am @@ -0,0 +1,15 @@ +BASE = tifileutil +RC ?= windres + +EXTRA_DIST = $(BASE).rc + +if OS_WIN32 + noinst_DATA = $(BASE)-rc.o +endif + +if OS_WIN32 +all: $(BASE)-rc.o + +$(BASE)-rc.o : $(BASE).rc + $(RC) $(BASE).rc $@ +endif diff --git a/tifileutil/build/mingw/tifileutil.rc b/tifileutil/build/mingw/tifileutil.rc new file mode 100644 index 000000000..a9473d542 --- /dev/null +++ b/tifileutil/build/mingw/tifileutil.rc @@ -0,0 +1,43 @@ +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +#include "winver.h" + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 0,1,0,0 + PRODUCTVERSION 0,1,0,0 + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS (VS_FF_PRERELEASE | VS_FF_DEBUG) +#else + FILEFLAGS (VS_FF_PRERELEASE) +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "This program is placed under GPL license. The license can be found on www.gnu.org\0" + VALUE "CompanyName", "Linux Programmer Group\0" + VALUE "FileDescription", "TI calculators file modification utility\0" + VALUE "FileVersion", "0.1.0\0" + VALUE "InternalName", "tifileutil\0" + VALUE "LegalCopyright", "Copyright \xA9 1999-2019, Romain Li\xE9vin, Julien Blache and contributors\0" + VALUE "LegalTrademarks", "The TiLP Team\0" + VALUE "OriginalFilename", "tifileutil.exe\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "TI file software for Linux, Windows Vista/7/8/8.1/10, Mac OS X and FreeBSD.\0" + VALUE "ProductVersion", "0.1.0\0" + VALUE "SpecialBuild", "Windows Vista/7/8/8.1/10 version\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END diff --git a/tifileutil/configure.ac b/tifileutil/configure.ac new file mode 100644 index 000000000..040038707 --- /dev/null +++ b/tifileutil/configure.ac @@ -0,0 +1,196 @@ +dnl Process this file with autoconf to produce a configure script. +dnl $Id$ + +# Init. +AC_PREREQ(2.57) +AC_INIT(TIFILEUTIL, 0.1, [tilp-users@lists.sourceforge.net]) + +dnl Release versioning info +VERSION="0.1" +AC_SUBST(VERSION) + +AM_INIT_AUTOMAKE([dist-bzip2]) +AM_MAINTAINER_MODE +AC_CONFIG_MACRO_DIR([m4]) + +AC_PREFIX_DEFAULT(/usr/local) + +# Files to configure. +AC_CONFIG_SRCDIR([src/main.cc]) +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_FILES([ + Makefile + build/Makefile + build/mingw/Makefile + man/Makefile + src/Makefile +]) + +# Setup libtool. +AC_DISABLE_STATIC +AC_LIBTOOL_WIN32_DLL +LT_INIT + +# Checks for programs. +AC_PROG_CC +AC_PROG_CXX +AM_PROG_CC_C_O +AC_PROG_INSTALL +AC_PROG_MAKE_SET +AC_PROG_LN_S +AC_ISC_POSIX +AC_PROG_AWK +AC_CHECK_PROG(GROFF, groff, yes, no) +AM_CONDITIONAL(USE_GROFF, test "$GROFF" != "no") +AC_CHECK_TOOL(RC, windres, windres) + +# Translation +AC_PROG_INTLTOOL([0.40.0]) + +GETTEXT_PACKAGE=tifileutil +AC_SUBST(GETTEXT_PACKAGE) +AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [tifileutil]) +AM_GLIB_GNU_GETTEXT + +# Checks for libraries. +PKG_CHECK_MODULES(TICONV, ticonv >= 1.1.6) +AC_SUBST(TICONV_CFLAGS) +AC_SUBST(TICONV_LIBS) + +PKG_CHECK_MODULES(TIFILES, tifiles2 >= 1.1.8) +AC_SUBST(TIFILES_CFLAGS) +AC_SUBST(TIFILES_LIBS) + +PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.6.0) +AC_SUBST(GLIB_CFLAGS) +AC_SUBST(GLIB_LIBS) + +# Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS([stdlib.h string.h unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_C_RESTRICT +AX_CXX_COMPILE_STDCXX_11(noext, mandatory) +AC_HEADER_STAT +AC_TYPE_UID_T +AC_TYPE_MODE_T +AC_TYPE_OFF_T +AC_STRUCT_TM + +# Checks for library functions. +AC_PROG_GCC_TRADITIONAL +AC_TYPE_SIGNAL +AC_FUNC_STAT +AC_CHECK_FUNCS([memset strchr strdup strrchr localtime_r]) + +# Platform specific tests. +dnl AC_CANONICAL_HOST +case "$host" in + *-*-mingw*) ARCH="-D__WIN32__ -D__MINGW32__ -mwindows" ;; + *-*-cygwin) ARCH="-D__WIN32__ -D__CYGWIN__ -mwindows -mno-cygwin" ;; + *-*-*bsd*) ARCH="-D__BSD__" ;; + *) ARCH="-D__LINUX__" ;; +esac +CFLAGS="$CFLAGS $ARCH" + +# Ensure MSVC-compatible struct packing convention is used when +# compiling for Win32 with gcc. +# What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while +# gcc2 uses "-fnative-struct". +case $host_os in +*mingw*|*cygwin*) + if test x$GCC = xyes; then + msnative_struct='' + AC_MSG_CHECKING([how to get MSVC-compatible struct packing]) + if test -z "$ac_cv_prog_CC"; then + our_gcc="$CC" + else + our_gcc="$ac_cv_prog_CC" + fi + case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in + 2.) + if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then + msnative_struct='-fnative-struct' + fi + ;; + *) + if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then + msnative_struct='-mms-bitfields' + fi + ;; + esac + if test x"$msnative_struct" = x ; then + AC_MSG_RESULT([no way]) + AC_MSG_WARN([produced libraries might be incompatible with MSVC-compiled code]) + else + CFLAGS="$CFLAGS $msnative_struct" + AC_MSG_RESULT([${msnative_struct}]) + fi + fi + ;; +esac + +AM_CONDITIONAL(OS_WIN32, test "$msnative_struct") + +# Check for the new -fvisibility=hidden flag introduced in gcc 4.0 +# Allow to reduce shared library size and avoid symbol clash +case $host_os in +*mingw*) + ;; +*) + if test x$GCC = xyes; then + visibility_flag='' + AC_MSG_CHECKING([whether gcc accepts -fvisibility]) + if test -z "$ac_cv_prog_CC"; then + our_gcc="$CC" + else + our_gcc="$ac_cv_prog_CC" + fi + if $our_gcc -v --help 2>/dev/null | grep "fvisibility" >/dev/null; then + visibility_flag='-fvisibility=hidden' + fi + if test x"$visibility_flag" = x ; then + AC_MSG_RESULT([no]) + else + CFLAGS="$CFLAGS $visibility_flag" + AC_MSG_RESULT([${visibility_flag}]) + AC_DEFINE(HAVE_FVISIBILITY, 1, [Use -fvisibility=hidden flag]) + fi + fi + ;; +esac + +# Find a C compiler for the build system (needed for compiling cleaner) +AC_ARG_VAR([CC_FOR_BUILD], [C compiler for programs to be run on the build system]) +AC_ARG_VAR([CFLAGS_FOR_BUILD], [C compiler flags for CC_FOR_BUILD]) +AC_MSG_CHECKING([for the host compiler]) +if test "x$build" == "x$host" ; then + # Not cross-compiling. + CC_FOR_BUILD=$CC + CFLAGS_FOR_BUILD=$CFLAGS + AC_MSG_RESULT([${CC_FOR_BUILD}]) +else + # Try to find the host CC among several choices + AC_CHECK_PROGS(CC_FOR_BUILD, [gcc cc clang c89 c99], [false]) + if test "x$CC_FOR_BUILD" = "xfalse" ; then + AC_MSG_FAILURE([not found.]) + else + AC_MSG_RESULT([${CC_FOR_BUILD}]) + fi +fi + +# some extra flags +CXXFLAGS="$CXXFLAGS -fno-rtti -fno-exceptions" + +AC_SUBST(CFLAGS) +AC_SUBST(LDFLAGS) +AC_SUBST(CXXFLAGS) + +# Output. +AC_OUTPUT([ +po/Makefile.in +]) + +echo "Now, you can type 'make' and 'make install'." diff --git a/tifileutil/man/Makefile.am b/tifileutil/man/Makefile.am new file mode 100644 index 000000000..3367959dd --- /dev/null +++ b/tifileutil/man/Makefile.am @@ -0,0 +1,20 @@ +man_MANS = tifileutil.1 +pkgdata_DATA = Manpage.txt + +EXTRA_DIST = $(man_MANS) cleaner.c Manpage.txt + +all: dist_win + +view: $(man_MANS) + groff -Tascii -man $(man_MANS) | less + +Manpage.txt: + groff -Tascii -man $(man_MANS) > Manpage + C_INCLUDE_PATH="" LIBRARY_PATH="" $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) cleaner.c -o cleaner + ./cleaner Manpage + rm -f Manpage cleaner + +dist_win: $(man_MANS) Manpage.txt + +clean: + rm -f Manpage.txt cleaner diff --git a/tifileutil/man/Manpage.txt b/tifileutil/man/Manpage.txt new file mode 100644 index 000000000..c33047082 --- /dev/null +++ b/tifileutil/man/Manpage.txt @@ -0,0 +1,100 @@ +TIFILEUTIL(1) General Commands Manual TIFILEUTIL(1) + +NAME + tifileutil - a program for manipulating computer files suitable for TI + graphing calculators + + +SYNOPSIS + tifileutil [-h / --help] [-v / --version] [command] [arguments] + + +DESCRIPTION + The tifileutil program allows you to perform various operations on com- + puter files suitable for the TI-Z80, TI-eZ80 and TI-68k series of + graphing calculators. + + +OPTIONS + tifileutil accepts the following options: + + + -h, --help + Display a list of all command line options and commands. + + + -v, --version + Output the version info. + + +EXAMPLES + Dump a file supposed to be suitable for TI calculators as a C hex array + to an output file: + + + tifileutil dump -f chexarray romdump_9x/romdump.89z -o rom89.h -n rom- + Dump89 -s romDumpSize89 -c 8 -m 64 + + + Create TI file header and footer for a raw binary: + + + tifileutil wrap -n 'ROMDUMP' dump83p.bin -p -o dump83p.8xp + + +COPYRIGHT + Copyright (C) 2006-2010 Benjamin Moody + + Copyright (C) 2010 Jon Sturm + + Copyright (C) 1999-2009 Romain Lievin + + Copyright (C) 2009-2023 Lionel Debroux + + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, pro- + vided that the above copyright notice appear in all copies and that + both that copyright notice and this permission notice appear in sup- + porting documentation. + + This program and its source code is distributed under the terms of the + terms of the GNU General Public License as published by the Free Soft- + ware Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of MER- + CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + +SUGGESTIONS AND BUG REPORTS + The canonical place to find tifileutil and some miscellaneous informa- + tion is at https://github.com/debrouxl/tilibs (www.tilp.info). + + You can also look at http://lpg.ticalc.org and http://www.ticalc.org + for others TI related programs for Linux. French people can also look + at http://www.ti-fr.org and http://tiplanet.org. + + +AUTHOR + Original authors: Romain Lievin (tf2hex), Benjamin Moody (tipack & + titools). + + tifileutil unified design and implementation, including modifications + to the original tools: Lionel Debroux. + + +THANKS + Thanks to the original authors of the code blocks embedded into + tifileutil. + + +SEE ALSO + tilp(1) + + August 1, 2023 TIFILEUTIL(1) diff --git a/tifileutil/man/cleaner.c b/tifileutil/man/cleaner.c new file mode 100644 index 000000000..d715d48aa --- /dev/null +++ b/tifileutil/man/cleaner.c @@ -0,0 +1,113 @@ +/* manpage_cleaner - remove the repetition of characters + * Copyright (C) 2000 Romain Liévin + * Copyright (C) 2009 Kevin Kofler + * Copyright (C) 2009 Lionel Debroux + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include + +int main(int argc, char **argv) +{ + char *filename = NULL; + char *filename2 = NULL; + FILE *in; + FILE *out; + char buffer[3]; + size_t len; + int retval = 0; + + /* Retrieve the command line argument */ + if(argc < 2) + { + fprintf(stderr, "You must give a filename on the command line.\n"); + retval = 1; + goto end; + } + + len = strlen(argv[1]); + filename = malloc(len+1); + filename2 = malloc(len+5); + if(filename == NULL || filename2 == NULL) + { + fprintf(stderr, "Cannot allocate memory.\n"); + retval = 1; + goto end; + } + strcpy(filename, argv[1]); + strcpy(filename2, filename); + strcat(filename2 + len, ".txt"); + + fprintf(stdout, "Processing file <%s>:\n", filename); + fprintf(stdout, "Pass 1... "); + + /* Open input file */ + in = fopen(filename, "rb"); + if(in == NULL) + { + fprintf(stderr, "Unable to open this file: <%s>\n", filename); + retval = 1; + goto end; + } + + /* Open output file */ + out = fopen(filename2, "wb"); + if(out == NULL) + { + fclose(in); + fprintf(stderr, "Unable to open this file: <%s>\n", filename2); + retval = 1; + goto end; + } + + /* Process the file for removing backspace sequences */ + while(!feof(in)) + { + buffer[0] = fgetc(in); + if(feof(in)) break; + buffer[1] = fgetc(in); + if(feof(in)) + { + fputc(buffer[0], out); + break; + } + + if(buffer[0] == '\b') + { + continue; // Skip the char and BS + } + if(buffer[1] == '\b') + { + fputc(fgetc(in), out); // Skip the 2 previous chars + continue; + } + fputc(buffer[0], out); + fputc(buffer[1], out); + } + fprintf(stdout, "Done.\n"); + + /* Close the files */ + fclose(in); + fclose(out); + +end: + free(filename2); + free(filename); + + return retval; +} diff --git a/tifileutil/man/tifileutil.1 b/tifileutil/man/tifileutil.1 new file mode 100644 index 000000000..68b12163c --- /dev/null +++ b/tifileutil/man/tifileutil.1 @@ -0,0 +1,67 @@ +.TH TIFILEUTIL 1 "August 1, 2023" + +.SH NAME +tifileutil - a program for manipulating computer files suitable for TI graphing calculators + +.SH SYNOPSIS +\fBtifileutil\fP [\-h / \-\-help] [\-v / \-\-version] [command] [arguments] + +.SH DESCRIPTION +The \fBtifileutil\fP program allows you to perform various operations on computer files suitable for the TI-Z80, TI-eZ80 and TI-68k series of graphing calculators. + +.SH OPTIONS +\fBtifileutil\fP accepts the following options: + +.TP +\fB\-h, \-\-help\fP +Display a list of all command line options and commands. + +.TP +\fB\-v, \-\-version\fP +Output the version info. + +.SH EXAMPLES +Dump a file supposed to be suitable for TI calculators as a C hex array to an output file: + +.TP +tifileutil dump -f chexarray romdump_9x/romdump.89z -o rom89.h -n romDump89 -s romDumpSize89 -c 8 -m 64 + +.TP +Create TI file header and footer for a raw binary: + +.TP +tifileutil wrap \-n 'ROMDUMP' dump83p.bin \-p \-o dump83p.8xp + +.SH COPYRIGHT +Copyright (C) 2006-2010 Benjamin Moody + +Copyright (C) 2010 Jon Sturm + +Copyright (C) 1999-2009 Romain Lievin + +Copyright (C) 2009-2023 Lionel Debroux + +Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. + +This program and its source code is distributed under the terms of the +terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +.SH SUGGESTIONS AND BUG REPORTS +The canonical place to find tifileutil and some miscellaneous information is at https://github.com/debrouxl/tilibs (www.tilp.info). + +You can also look at http://lpg.ticalc.org and http://www.ticalc.org for others TI related programs for Linux. French people can also look at http://www.ti-fr.org and http://tiplanet.org. + +.SH AUTHOR +Original authors: Romain Lievin (tf2hex), Benjamin Moody (tipack & titools). + +tifileutil unified design and implementation, including modifications to the original tools: Lionel Debroux. + +.SH THANKS +Thanks to the original authors of the code blocks embedded into tifileutil. + +.SH SEE ALSO +tilp(1) diff --git a/tifileutil/po/LINGUAS b/tifileutil/po/LINGUAS new file mode 100644 index 000000000..d6751a7ed --- /dev/null +++ b/tifileutil/po/LINGUAS @@ -0,0 +1,2 @@ +# Set of available languages. +fr diff --git a/tifileutil/po/Makefile.in.in b/tifileutil/po/Makefile.in.in new file mode 100644 index 000000000..fcd2c3b70 --- /dev/null +++ b/tifileutil/po/Makefile.in.in @@ -0,0 +1,221 @@ +# Makefile for program source directory in GNU NLS utilities package. +# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper +# Copyright (C) 2004-2008 Rodney Dawes +# +# This file may be copied and used freely without restrictions. It may +# be used in projects which are not available under a GNU Public License, +# but which still want to provide support for the GNU gettext functionality. +# +# - Modified by Owen Taylor to use GETTEXT_PACKAGE +# instead of PACKAGE and to look for po2tbl in ./ not in intl/ +# +# - Modified by jacob berkman to install +# Makefile.in.in and po2tbl.sed.in for use with glib-gettextize +# +# - Modified by Rodney Dawes for use with intltool +# +# We have the following line for use by intltoolize: +# INTLTOOL_MAKEFILE + +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +top_builddir = @top_builddir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +datadir = @datadir@ +datarootdir = @datarootdir@ +libdir = @libdir@ +localedir = @localedir@ +subdir = po +install_sh = @install_sh@ +# Automake >= 1.8 provides @mkdir_p@. +# Until it can be supposed, use the safe fallback: +mkdir_p = $(install_sh) -d + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +GMSGFMT = @GMSGFMT@ +MSGFMT = @MSGFMT@ +XGETTEXT = @XGETTEXT@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +MSGMERGE = INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist +GENPOT = INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot + +ALL_LINGUAS = @ALL_LINGUAS@ + +PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi) + +USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep \^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep \^$$lang$$`"; then printf "$$lang "; fi; done; fi) + +USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) + +POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) + +DISTFILES = Makefile.in.in POTFILES.in $(POFILES) +EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS + +POTFILES = \ +# This comment gets stripped out + +CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) + +.SUFFIXES: +.SUFFIXES: .po .pox .gmo .mo .msg .cat + +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +INTLTOOL_V_MSGFMT = $(INTLTOOL__v_MSGFMT_$(V)) +INTLTOOL__v_MSGFMT_= $(INTLTOOL__v_MSGFMT_$(AM_DEFAULT_VERBOSITY)) +INTLTOOL__v_MSGFMT_0 = @echo " MSGFMT" $@; + +.po.pox: + $(MAKE) $(GETTEXT_PACKAGE).pot + $(MSGMERGE) $* $(GETTEXT_PACKAGE).pot -o $*.pox + +.po.mo: + $(INTLTOOL_V_MSGFMT)$(MSGFMT) -o $@ $< + +.po.gmo: + $(INTLTOOL_V_MSGFMT)file=`echo $* | sed 's,.*/,,'`.gmo \ + && rm -f $$file && $(GMSGFMT) -o $$file $< + +.po.cat: + sed -f ../intl/po2msg.sed < $< > $*.msg \ + && rm -f $@ && gencat $@ $*.msg + + +all: all-@USE_NLS@ + +all-yes: $(CATALOGS) +all-no: + +$(GETTEXT_PACKAGE).pot: $(POTFILES) + $(GENPOT) + +install: install-data +install-data: install-data-@USE_NLS@ +install-data-no: all +install-data-yes: all + linguas="$(USE_LINGUAS)"; \ + for lang in $$linguas; do \ + dir=$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES; \ + $(mkdir_p) $$dir; \ + if test -r $$lang.gmo; then \ + $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ + echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ + else \ + $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ + echo "installing $(srcdir)/$$lang.gmo as" \ + "$$dir/$(GETTEXT_PACKAGE).mo"; \ + fi; \ + if test -r $$lang.gmo.m; then \ + $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ + echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ + else \ + if test -r $(srcdir)/$$lang.gmo.m ; then \ + $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ + $$dir/$(GETTEXT_PACKAGE).mo.m; \ + echo "installing $(srcdir)/$$lang.gmo.m as" \ + "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ + else \ + true; \ + fi; \ + fi; \ + done + +# Empty stubs to satisfy archaic automake needs +dvi info ctags tags CTAGS TAGS ID: + +# Define this as empty until I found a useful application. +install-exec installcheck: + +uninstall: + linguas="$(USE_LINGUAS)"; \ + for lang in $$linguas; do \ + rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ + rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ + done + +check: all $(GETTEXT_PACKAGE).pot + rm -f missing notexist + srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m + if [ -r missing -o -r notexist ]; then \ + exit 1; \ + fi + +mostlyclean: + rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp + rm -f .intltool-merge-cache + +clean: mostlyclean + +distclean: clean + rm -f Makefile Makefile.in POTFILES stamp-it + rm -f *.mo *.msg *.cat *.cat.m *.gmo + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + rm -f Makefile.in.in + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist distdir: $(DISTFILES) + dists="$(DISTFILES)"; \ + extra_dists="$(EXTRA_DISTFILES)"; \ + for file in $$extra_dists; do \ + test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ + done; \ + for file in $$dists; do \ + test -f $$file || file="$(srcdir)/$$file"; \ + ln $$file $(distdir) 2> /dev/null \ + || cp -p $$file $(distdir); \ + done + +update-po: Makefile + $(MAKE) $(GETTEXT_PACKAGE).pot + tmpdir=`pwd`; \ + linguas="$(USE_LINGUAS)"; \ + for lang in $$linguas; do \ + echo "$$lang:"; \ + result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ + if $$result; then \ + if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.gmo failed!"; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi; \ + done + +Makefile POTFILES: stamp-it + @if test ! -f $@; then \ + rm -f stamp-it; \ + $(MAKE) stamp-it; \ + fi + +stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ + $(SHELL) ./config.status + +# Tell versions [3.59,3.63) of GNU make not to export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tifileutil/po/POTFILES.in b/tifileutil/po/POTFILES.in new file mode 100644 index 000000000..0c8abadab --- /dev/null +++ b/tifileutil/po/POTFILES.in @@ -0,0 +1 @@ +src/main.cc diff --git a/tifileutil/po/fr.po b/tifileutil/po/fr.po new file mode 100644 index 000000000..54c5dc18b --- /dev/null +++ b/tifileutil/po/fr.po @@ -0,0 +1,31 @@ +# French locale for tifileutil +# Copyright (C) 2019 Lionel Debroux +# This file is distributed under the same license as the tifileutil package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: tifileutil 0.1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-09-14 00:03+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Lionel Debroux \n" +"Language-Team: Français \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: ../src/main.cc:953 +#, c-format +msgid "libticonv library version is %s but %s mini required.\n" +msgstr "" +"la version de la librairie libticonv est %s mais la version minimum est %s.\n" + +#: ../src/main.cc:959 +#, c-format +msgid "libtifiles library version is %s but %s mini required.\n" +msgstr "" +"la version de la librairie libtifiles est %s mais la version minimum est " +"%s.\n" diff --git a/tifileutil/src/Makefile.am b/tifileutil/src/Makefile.am new file mode 100644 index 000000000..95465bf69 --- /dev/null +++ b/tifileutil/src/Makefile.am @@ -0,0 +1,23 @@ +## Process this file with automake to produce Makefile.in + +AM_CFLAGS = -Wall + +# programs and files to compile and install +bin_PROGRAMS = tifileutil + +# build instructions +tifileutil_CPPFLAGS = -I$(top_srcdir)/intl \ + @TIFILES_CFLAGS@ @TICONV_CFLAGS@ \ + @GLIB_CFLAGS@ \ + -DSHARE_DIR=\"$(pkgdatadir)\" \ + -DLOCALEDIR=\"$(datadir)/locale\" \ + -DSYSCONFDIR=\"$(sysconfdir)\" +tifileutil_LDFLAGS = +tifileutil_LDADD = @GLIB_LIBS@ @TIFILES_LIBS@ @TICONV_LIBS@ +tifileutil_SOURCES = *.h \ + main.cc + +if OS_WIN32 + tifileutil_DEPENDENCIES = ../build/mingw/tifileutil-rc.o + tifileutil_LDFLAGS += -Wl,../build/mingw/tifileutil-rc.o +endif diff --git a/tifileutil/src/gettext.h b/tifileutil/src/gettext.h new file mode 100644 index 000000000..606a0d0d9 --- /dev/null +++ b/tifileutil/src/gettext.h @@ -0,0 +1,88 @@ +/* Convenience header for conditional use of GNU . + Copyright (C) 1995-1998, 2000-2002, 2004 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + USA. */ + +#ifndef _LIBGETTEXT_H +#define _LIBGETTEXT_H 1 + +/* NLS can be disabled through the configure --disable-nls option. */ +#if ENABLE_NLS + +/* Get declarations of GNU message catalog functions. */ +# include + +#else + +/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which + chokes if dcgettext is defined as a macro. So include it now, to make + later inclusions of a NOP. We don't include + as well because people using "gettext.h" will not include , + and also including would fail on SunOS 4, whereas + is OK. */ +#if defined(__sun) +# include +#endif + +/* Many header files from the libstdc++ coming with g++ 3.3 or newer include + , which chokes if dcgettext is defined as a macro. So include + it now, to make later inclusions of a NOP. */ +#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) +# include +# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H +# include +# endif +#endif + +/* Disabled NLS. + The casts to 'const char *' serve the purpose of producing warnings + for invalid uses of the value returned from these functions. + On pre-ANSI systems without 'const', the config.h file is supposed to + contain "#define const". */ +# define gettext(Msgid) ((const char *) (Msgid)) +# define dgettext(Domainname, Msgid) ((const char *) (Msgid)) +# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) +# define ngettext(Msgid1, Msgid2, N) \ + ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) +# define dngettext(Domainname, Msgid1, Msgid2, N) \ + ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) +# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ + ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) +# define textdomain(Domainname) ((const char *) (Domainname)) +# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname)) +# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) + +#endif + +/* A pseudo function call that serves as a marker for the automated + extraction of messages, but does not call gettext(). The run-time + translation is done at a different place in the code. + The argument, String, should be a literal string. Concatenated strings + and other string expressions won't work. + The macro's expansion is not parenthesized, so that it is suitable as + initializer for static 'char[]' or 'const char[]' variables. */ +#define gettext_noop(String) String + +/* Short gettext aliases. */ +#define _(String) dgettext(PACKAGE, String) +#define N_(String) gettext_noop(String) + +#if defined(__WIN32__) && !defined(__MINGW32__) +# undef PACKAGE +# define PACKAGE "libticalcs2" // name of package +#endif + +#endif /* _LIBGETTEXT_H */ diff --git a/tifileutil/src/logging.h b/tifileutil/src/logging.h new file mode 100644 index 000000000..be4afc1b0 --- /dev/null +++ b/tifileutil/src/logging.h @@ -0,0 +1,40 @@ +/* Hey EMACS -*- linux-c -*- */ + +/* libtifiles - Ti File Format library, a part of the TiLP project + * Copyright (C) 1999-2006 Romain Lievin + * Copyright (C) 2019 Lionel Debroux + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* + Domain name logging. +*/ + +#ifndef __TIFILEUTIL_LOG_H__ +#define __TIFILEUTIL_LOG_H__ + +#include + +#define LOG_DOMAIN "tifileutil" + +#define tifileutil_debug(format, ...) g_log(LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format, ##__VA_ARGS__) +#define tifileutil_info(format, ...) g_log(LOG_DOMAIN, G_LOG_LEVEL_INFO, format, ##__VA_ARGS__) +#define tifileutil_warning(format, ...) g_log(LOG_DOMAIN, G_LOG_LEVEL_WARNING, format, ##__VA_ARGS__) +#define tifileutil_critical(format, ...) g_log(LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, format, ##__VA_ARGS__) +#define tifileutil_error(format, ...) g_log(LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, ##__VA_ARGS__) + +#endif + diff --git a/tifileutil/src/main.cc b/tifileutil/src/main.cc new file mode 100644 index 000000000..9b37d06c3 --- /dev/null +++ b/tifileutil/src/main.cc @@ -0,0 +1,1010 @@ +/* + * tifileutil -- program to create / manipulate TI data files + * + * Copyright (C) 2006-2010 Benjamin Moody (tipack, titools) + * Copyright (C) 2010 Jon Sturm (titools) + * Copyright (C) 1999-2009 Romain Lievin (tf2hex) + * Copyright (C) 2009-2019 Lionel Debroux (tf2hex) + * Copyright (C) 2019-2023 Lionel Debroux (tifileutil) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef HAVE_CONFIG_H +# include +#endif +#include "gettext.h" +#include "logging.h" + +#define TIFILEUTIL_REQUIRES_LIBTICONV_VERSION "1.1.6" +#define TIFILEUTIL_REQUIRES_LIBTIFILES2_VERSION "1.1.8" + +static char * progname = nullptr; + +static int err_print(const char* func, int errcode) +{ + char* p; + if (errcode) { + tifiles_error_get(errcode, &p); + tifileutil_critical("error in %s:\n%s\n", func, p); + tifiles_error_free(p); + } + return errcode; +} + +static int type_name_is_tokenized(CalcModel model, uint8_t type_id) +{ + if (model == CALC_TI73) { + return (type_id != TI73_PRGM && type_id != TI73_ASM && type_id != TI73_DIR && type_id != TI73_AVAR && type_id < 0x20); + } + + if (model == CALC_TI82 || model == CALC_TI83 || model == CALC_TI83P || model == CALC_TI84P || model == CALC_TI84PC) { + return ( type_id != TI82_PRGM && type_id != TI82_PPGM && type_id != TI83p_APPOBJ && type_id != TI83p_APPVAR + && type_id != TI83p_TEMPPROGOBJ && type_id != TI83p_GRP && type_id < 0x20); + } + + // Other models and types. + return 0; +} + +static int type_has_length(CalcModel model, uint8_t type_id) +{ + if (!ticonv_model_is_tiz80(model) && !ticonv_model_is_tiez80(model)) { + return 0; + } + + if (model == CALC_TI85 || model == CALC_TI86) { + return (type_id == TI85_EQU || type_id == TI85_STRNG || type_id == TI85_PICT || type_id == TI85_PRGM); + } + + if (model == CALC_TI82 || model == CALC_TI83) { + return (type_id == TI82_YVAR || type_id == TI83_STRNG || type_id == TI82_PRGM || type_id == TI82_PPGM || type_id == TI82_PIC); + } + + if (model == CALC_TI73) { + return (type_id == TI73_EQU || type_id == TI73_STRNG || type_id == TI73_PRGM || type_id == TI73_ASM || type_id == TI73_PIC || type_id == TI73_AVAR); + } + + return (type_id == TI83p_EQU || type_id == TI83p_STRNG || type_id == TI83p_PRGM || type_id == TI83p_ASM || type_id == TI83p_PIC || type_id == TI83p_APPVAR); +} + +static int type_is_ti68k_oth(CalcModel model, uint8_t type_id) +{ + if (model == CALC_TI89 || model == CALC_TI92P || model == CALC_V200 || model == CALC_TI89T || model == CALC_TI89T_USB) { + return (type_id == TI89_ZIP); + } + + // Other models and types. + return 0; +} + +static int protect_type(CalcModel model, uint8_t type_id) +{ + return (( tifiles_calc_is_ti8x(model) + && model != CALC_TI85 + && model != CALC_TI86 + && type_id == TI82_PRGM) ? type_id + 1 + : type_id); +} + +static int complexify_type(CalcModel model, uint8_t type_id) +{ + if (tifiles_calc_is_ti9x(model)) { + return ((type_id == TI89_LIST || type_id == TI89_MAT) ? type_id + 1 : type_id); + } + + if (model == CALC_TI85 || model == CALC_TI86) { + return ( (type_id == TI85_REAL || type_id == TI85_VECTR + || type_id == TI85_LIST || type_id == TI85_MATRX + || type_id == TI85_CONS) ? type_id + 1 + : type_id); + } + + if (model == CALC_TI82 || model == CALC_TI73) { + return type_id; + } + + return ((type_id == TI83_REAL || type_id == TI83_LIST) ? type_id + TI83_CPLX : type_id); +} + +typedef int (*FNCT_USAGE) (int *, char ***); +typedef int (*FNCT_MENU) (int *, char ***, unsigned int); + +static int tifileutil_wrap_usage(int * argc, char *** argv) +{ + fprintf(stderr, R"x(Usage: %s wrap [OPTIONS] [FILE | -] +Where OPTIONS may include: + -o OUTFILE: output result to OUTFILE + -n NAME: set on-calc variable name to NAME (TI-Z80, TI-eZ80, TI-68k) + -f NAME: set on-calc variable folder to NAME (TI-68k) + -t TYPE: set variable type to TYPE (e.g. 82p) + -V VERSION: set file version to VERSION (TI-Z80, TI-eZ80) + -c COMMENT: set file comment to COMMENT (strftime format string) + -x EXTENSION: set 1-4 chars "extension" for "other" variable type (TI-68k) + -p: protect program (TI-Z80, TI-eZ80) + -C: number/list/matrix is complex (TI-Z80, TI-eZ80) + -a: mark file for sending to archive (TI-Z80, TI-eZ80, TI-68k) + -l: mark file locked (TI-68k) + -r: raw mode (no length bytes) + -v: be verbose +)x", (*argv)[0]); + return 1; +} + +static int tifileutil_wrap(int * argc, char *** argv, unsigned int offset) +{ + int ret; + + const char * infilename = nullptr; + char * outfilename = nullptr; + char * varname = nullptr; + char * foldername = nullptr; + char * vartype = nullptr; + const char * comment = "Created by " PACKAGE " " PACKAGE_VERSION; + const char * versionstr = nullptr; + const char * extensionstr = nullptr; + int protect = 0; + int complexify = 0; + int archive = 0; + int lock = 0; + int rawmode = 0; + int verbose = 0; + CalcModel model; + uint8_t type_id; + FILE * infile; + FileContent * fc = nullptr; + VarEntry * ve = nullptr; + unsigned long dsize, dalloc = 1024; + bool outfilename_is_allocated = false; + bool varname_is_allocated = false; + + int i, j; + char * p; + const char * cp; + time_t t; + + for (i = offset + 1; i < *argc; i++) { + if ((*argv)[i][0] == '-' && (*argv)[i][1]) { + for (j = 1; (*argv)[i][j]; j++) { + switch ((*argv)[i][j]) { + case 'o': + if ((*argv)[i][++j]) { + outfilename = &((*argv)[i][j]); + } + else { + outfilename = (*argv)[++i]; + } + j = strlen((*argv)[i]) - 1; + break; + + case 'n': + if ((*argv)[i][++j]) { + varname = &((*argv)[i][j]); + } + else { + varname = (*argv)[++i]; + } + j = strlen((*argv)[i]) - 1; + break; + + case 'f': + if ((*argv)[i][++j]) { + foldername = &((*argv)[i][j]); + } + else { + foldername = (*argv)[++i]; + } + j = strlen((*argv)[i]) - 1; + break; + + case 't': + if ((*argv)[i][++j]) { + vartype = &((*argv)[i][j]); + } + else { + vartype = (*argv)[++i]; + } + j = strlen((*argv)[i]) - 1; + break; + + case 'c': + if ((*argv)[i][++j]) { + comment = (const char *)&((*argv)[i][j]); + } + else { + comment = (const char *)(*argv)[++i]; + } + j = strlen((*argv)[i]) - 1; + break; + + case 'V': + if ((*argv)[i][++j]) { + versionstr = (const char *)&((*argv)[i][j]); + } + else { + versionstr = (const char *)(*argv)[++i]; + } + j = strlen((*argv)[i]) - 1; + break; + + case 'x': + if ((*argv)[i][++j]) { + extensionstr = (const char *)&((*argv)[i][j]); + } + else { + extensionstr = (const char *)(*argv)[++i]; + } + j = strlen((*argv)[i]) - 1; + break; + + case 'p': + protect = 1; + break; + + case 'C': + complexify = 1; + break; + + case 'a': + archive = 1; + break; + + case 'l': + lock = 1; + break; + + case 'r': + rawmode = 1; + break; + + case 'v': + verbose = 1; + break; + + default: + tifileutil_critical("%s: unknown option -%c\n", (*argv)[0], (*argv)[i][j]); + return tifileutil_wrap_usage(argc, argv); + } + } + } + else if ((*argv)[i][0] != '-') { + infilename = (const char *)(*argv)[i]; + } + } + + /* Set default outfilename or vartype */ + + if (!outfilename && vartype) { + if (infilename) { + outfilename = (char *)malloc(strlen(infilename) + strlen(vartype) + 2); + if (!outfilename) { + goto oom; + } + outfilename_is_allocated = true; + strcpy(outfilename, infilename); + if ((p = strrchr(outfilename, '.'))) { + *p = 0; + } + strcat(outfilename, "."); + strcat(outfilename, vartype); + } + else { + outfilename = (char *)malloc(strlen(vartype) + 3); + if (!outfilename) { + goto oom; + } + outfilename_is_allocated = true; + sprintf(outfilename, "a.%s", vartype); + } + } + else if (outfilename && !vartype) { + if ((p = strrchr(outfilename, '.'))) { + vartype = &(p[1]); + } + } + + if (!vartype) { + tifileutil_critical("%s: no variable type specified.", (*argv)[0]); + return 1; + } + + p = (char *)malloc(strlen(vartype) + 3); + if (!p) { +oom: + tifileutil_critical("%s: cannot allocate memory\n", (*argv)[0]); + ret = 1; + goto end; + } + sprintf(p, "a.%s", vartype); + model = tifiles_file_get_model(p); + free(p); + + if (!model) { + tifileutil_critical("%s: invalid variable type %s\n", (*argv)[0], vartype); + ret = 1; + goto end; + } + + type_id = tifiles_fext2vartype(model, vartype); + cp = tifiles_vartype2fext(model, type_id); + if (!cp || !cp[0]) { + tifileutil_critical("%s: invalid variable type %s\n", (*argv)[0], vartype); + ret = 1; + goto end; + } + + if (protect) { + type_id = protect_type(model, type_id); + } + if (complexify) { + type_id = complexify_type(model, type_id); + } + + if (!varname) { + p = strrchr(outfilename, '.'); + if (p) { + *p = 0; + } + if (type_name_is_tokenized(model, type_id)) { + varname = ticonv_varname_tokenize(model, outfilename, type_id); + varname_is_allocated = true; + } + else { + varname = (char *)ticonv_varname_strdup(outfilename); + for (i = 0; outfilename[i]; i++) { + if (outfilename[i] >= 'A' && outfilename[i] <= 'Z') { + varname[i] = outfilename[i]; + } + else if (outfilename[i] >= 'a' && outfilename[i] <= 'z') { + varname[i] = outfilename[i] + 'A' - 'a'; + } + else if (outfilename[i] >= '0' && outfilename[i] <= '9') { + varname[i] = outfilename[i]; + } + else { + varname[i] = '['; + } + } + varname[i] = 0; + varname_is_allocated = true; + } + if (p) { + *p = '.'; + } + } + + if (infilename) { + infile = fopen(infilename, "rb"); + if (!infile) { + perror(infilename); + ret = 2; + goto end; + } + } + else { + infilename = "(standard input)"; + infile = stdin; + } + + ve = tifiles_ve_create_alloc_data(dalloc); + if (nullptr == ve) { + goto oom; + } + if (!rawmode && type_has_length(model, type_id)) { + dsize = 2; + } + else { + dsize = 0; + } + ve->size = dsize; + + i = fgetc(infile); + while (!feof(infile) && !ferror(infile)) { + if (dsize >= dalloc) { + dalloc += 1024; + ve->size = dsize; + VarEntry * ve2 = tifiles_ve_realloc_data(ve, dalloc); + if (nullptr == ve2) { + goto oom; + } + } + ve->data[dsize++] = i; + i = fgetc(infile); + } + ve->size = dsize; + + if (infile != stdin) { + fclose(infile); + } + + if (!rawmode && type_has_length(model, type_id)) { + ve->data[0] = (dsize - 2) & 0xff; + ve->data[1] = ((dsize - 2) >> 8) & 0xff; + } + + if (nullptr != extensionstr && extensionstr[0] != 0 && type_is_ti68k_oth(model, type_id)) { + if (dalloc < dsize + 7) { + dalloc += 7; + ve->size = dsize; + VarEntry * ve2 = tifiles_ve_realloc_data(ve, dalloc); + if (nullptr == ve2) { + goto oom; + } + } + ve->data[dsize++] = 0; + ve->data[dsize++] = extensionstr[0]; + if (extensionstr[1] != 0) { + ve->data[dsize++] = extensionstr[1]; + if (extensionstr[2] != 0) { + ve->data[dsize++] = extensionstr[2]; + if (extensionstr[3] != 0) { + ve->data[dsize++] = extensionstr[3]; + } + } + } + ve->data[dsize++] = 0; + ve->data[dsize++] = 0xF8; // OTH_TAG + ve->size = dsize; + } + + fc = tifiles_content_create_regular(model); + + if (comment) { + if (strchr(comment, '%')) { + time(&t); + strftime(fc->comment, 40, comment, localtime(&t)); + } + else { + strncpy(fc->comment, comment, 40); + fc->comment[40 - 1] = 0; + } + } + + memset(ve->folder, 0, FLDNAME_MAX); + if (nullptr != foldername) { + strncpy(ve->folder, foldername, VARNAME_MAX); + } + memset(ve->name, 0, VARNAME_MAX); + strncpy(ve->name, varname, VARNAME_MAX); + ve->type = type_id; + ve->attr = (archive ? ATTRB_ARCHIVED : 0) | (lock ? ATTRB_LOCKED : 0); + // Intentionally leverage atoi()'s lack of error checking: fall back to 0 if the version string isn't an integer. + ve->version = (versionstr == nullptr ? 0 : atoi(versionstr)); + ve->size = dsize; + + // tifiles_content_add_entry returns the number of entries. + i = !tifiles_content_add_entry(fc, ve); + if (!i) { + i = err_print("tifiles_file_write_regular", tifiles_file_write_regular(outfilename, fc, 0)); + + if (!i && verbose) { + tifiles_file_display_regular(fc); + } + + /*i = */err_print("tifiles_content_del_entry", tifiles_content_del_entry(fc, ve)); + ve = nullptr; + } + + ret = i ? 3 : 0; + +end: + if (nullptr != ve) { + tifiles_ve_delete(ve); + } + tifiles_content_delete_regular(fc); + + if (varname_is_allocated) { + ticonv_varname_free(varname); + } + if (outfilename_is_allocated) { + free(outfilename); + } + + return ret; +} + +static int tifileutil_unwrap_usage(int * argc, char *** argv) +{ + fprintf(stderr, R"x(Usage: %s unwrap [OPTIONS] [FILE | -] +Where OPTIONS may include: + -o OUTFILE: output result to OUTFILE + -d: deep unwrapping (beyond computer-side header and footer) + -v: be verbose +)x", (*argv)[0]); + return 1; +} + +static int tifileutil_unwrap(int * argc, char *** argv, unsigned int offset) +{ + int ret; + + const char * infilename = nullptr; + char * outfilename = nullptr; + FILE * infile; + int deep = 0; + int verbose = 0; + + int i, j; + + for (i = offset + 1; i < *argc; i++) { + if ((*argv)[i][0] == '-' && (*argv)[i][1]) { + for (j = 1; (*argv)[i][j]; j++) { + switch ((*argv)[i][j]) { + case 'o': + if ((*argv)[i][++j]) { + outfilename = &((*argv)[i][j]); + } + else { + outfilename = (*argv)[++i]; + } + j = strlen((*argv)[i]) - 1; + break; + + case 'd': + deep = 1; + break; + + case 'v': + verbose = 1; + break; + + default: + tifileutil_critical("%s: unknown option -%c\n", (*argv)[0], (*argv)[i][j]); + return tifileutil_unwrap_usage(argc, argv); + } + } + } + else if ((*argv)[i][0] != '-') { + infilename = (const char *)(*argv)[i]; + } + } + + if (infilename) { + infile = fopen(infilename, "rb"); + if (!infile) { + perror(infilename); + ret = 2; + goto end; + } + } + else { + infilename = "(standard input)"; + infile = stdin; + } + + tifileutil_info("%s: unwrap infilename=%s outfilename=%s deep=%d verbose=%d.\n", (*argv)[0], infilename, outfilename, deep, verbose); + tifileutil_critical("%s: unwrap not implemented yet.\n", (*argv)[0]); + + ret = 3; + +end: + return ret; +} + +static int tifileutil_dump_usage(int * argc, char *** argv) +{ + fprintf(stderr, R"x(Usage: %s dump [OPTIONS] [FILE | -] +Where OPTIONS may include: + -f FORMAT: format result as FORMAT (only 'chexarray' is supported for now) + -o OUTFILE: output result to OUTFILE + -n NAME: set C hex array name to NAME + -s NAME: set C hex size variable name to NAME + -c COUNT: print COUNT items per line of the array + -m MINSIZE: set minimum file size + -v: be verbose +)x", (*argv)[0]); + return 1; +} + +static int tifileutil_dump(int * argc, char *** argv, unsigned int offset) +{ + int ret = 1; + + const char * format = nullptr; + const char * infilename = nullptr; + const char * outfilename = nullptr; + const char * arrayname = nullptr; + const char * arraysizename = nullptr; + const char * itemsperlinestr = nullptr; + const char * minsizestr = nullptr; + int verbose = 0; + FILE * infile, * outfile = nullptr; + struct stat st; + unsigned long length, lenread, itemsperline = 8, minsize = 64; + unsigned char data[65636]; // +100 for the header and footer. + unsigned long i, j; + + if (nullptr == (*argv)[2]) { + return tifileutil_dump_usage(argc, argv); + } + + for (i = offset + 3; i < (unsigned long)*argc; i++) { + if ((*argv)[i][0] == '-' && (*argv)[i][1]) { + for (j = 1; (*argv)[i][j]; j++) { + switch ((*argv)[i][j]) { + case 'f': + if ((*argv)[i][++j]) { + format = &((*argv)[i][j]); + } + else { + format = (*argv)[++i]; + } + j = strlen((*argv)[i]) - 1; + break; + + case 'o': + if ((*argv)[i][++j]) { + outfilename = &((*argv)[i][j]); + } + else { + outfilename = (*argv)[++i]; + } + j = strlen((*argv)[i]) - 1; + break; + + case 'n': + if ((*argv)[i][++j]) { + arrayname = &((*argv)[i][j]); + } + else { + arrayname = (*argv)[++i]; + } + j = strlen((*argv)[i]) - 1; + break; + + case 's': + if ((*argv)[i][++j]) { + arraysizename = &((*argv)[i][j]); + } + else { + arraysizename = (*argv)[++i]; + } + j = strlen((*argv)[i]) - 1; + break; + + case 'c': + if ((*argv)[i][++j]) { + itemsperlinestr = &((*argv)[i][j]); + } + else { + itemsperlinestr = (*argv)[++i]; + } + j = strlen((*argv)[i]) - 1; + errno = 0; + itemsperline = strtoul(itemsperlinestr, nullptr, 0); + if (errno != 0 || itemsperline < 1 || itemsperline > sizeof(data)) { + tifileutil_critical("%s: invalid number of items per line.\n", (*argv)[0]); + return ret; + } + break; + + case 'm': + if ((*argv)[i][++j]) { + minsizestr = &((*argv)[i][j]); + } + else { + minsizestr = (*argv)[++i]; + } + j = strlen((*argv)[i]) - 1; + errno = 0; + minsize = strtoul(minsizestr, nullptr, 0); + if (errno != 0 || minsize > sizeof(data)) { + tifileutil_critical("%s: invalid minimum size.\n", (*argv)[0]); + return ret; + } + break; + + case 'v': + verbose = 1; + break; + + default: + tifileutil_critical("%s: unknown option -%c\n", (*argv)[0], (*argv)[i][j]); + return tifileutil_dump_usage(argc, argv); + } + } + } + else if ((*argv)[i][0] != '-') { + infilename = (const char *)(*argv)[i]; + } + } + + if (nullptr != format && strcmp(format, "chexarray")) { + tifileutil_critical("%s: unsupported format %s\n", (*argv)[0], format); + return ret; + } + + if (minsize < 64) { + tifileutil_warning("%s: the specified minimum size is too small for a valid TI graphing calculator file.\n", (*argv)[0]); + } + + // read input file + if (nullptr == infilename || (infilename[0] == '-' && infilename[1] == 0)) { + infile = stdin; + } + else { + infile = fopen(infilename, "rb"); + if (nullptr == infile) { + tifileutil_critical("%s: unable to open input file.\n", (*argv)[0]); + return ret; + } + } + + if (!outfilename || (outfilename[0] == '-' && outfilename[1] == 0)) { + outfile = stdout; + } + + fstat(fileno(infile), &st); + length = st.st_size; + + lenread = fread(data, sizeof(char), length < sizeof(data) ? length : sizeof(data), infile); + + if (infile != stdin) { + fclose(infile); + } + + if (outfile != stdout && verbose) { + fprintf(stdout, "Read %ld bytes.\n", lenread); + } + + if (length < minsize) { + tifileutil_critical("%s: file is smaller than the specified minimum size.\n", (*argv)[0]); + return ret; + } + + if (lenread == length) { + // write output file + if (nullptr == outfile) { + outfile = fopen(outfilename, "wt"); + if (nullptr == outfile) { + tifileutil_critical("%s: unable to open output file.\n", (*argv)[0]); + return ret; + } + } + + // Produce hex digits while checking / computing checksum. + fprintf(outfile, "static unsigned char %s[] = {\n", arrayname); + for (i = 0; i < length; i += itemsperline) { + for (j = 0; (j < itemsperline) && (i + j < length); j++) { + fprintf(outfile, "0x%02x, ", data[i + j]); + } + fputc('\n', outfile); + } + // TODO: 2 last digits. + fprintf(outfile, "};\nstatic unsigned int %s = sizeof(%s)/sizeof(%s[0]); // %ld\n", arraysizename, arrayname, arrayname, length); + + if (outfile != stdout) { + fclose(outfile); + } + + ret = 0; + } + else { + tifileutil_critical("%s: unable to read the entire input file.\n", (*argv)[0]); + return ret; + } + + return ret; +} + +/* + -n NAME: set on-calc variable name to NAME + -f NAME: set on-calc variable folder to NAME + -t TYPE: set variable type to TYPE (e.g. 82p) + -V VERSION: set file version to VERSION (TI-Z80, TI-eZ80) + -c COMMENT: set file comment to COMMENT (strftime format string) + -a: mark file for sending to archive (TI-Z80, TI-eZ80, TI-68k) + -l: mark file locked (TI-68k) +*/ +static int tifileutil_metadata_usage(int * argc, char *** argv) +{ + fprintf(stderr, R"x(Usage: %s metadata -m MODE [OPTIONS] [FILE | -] +Where MODE may be: + gather: print metadata from a file under a parsable "key": "value" form + apply: apply metadata from the "key": "value" form generated by gather or a compatible tool + get: retrieve a single piece of metadata from a file. + set: set one or more pieces of metadata on a file. + +Generic OPTIONS may include: + -o FILE: output result to FILE + -v: be verbose + +OPTIONS for get mode may include (a single option at a time): + -n: get on-calc variable name (TI-Z80, TI-eZ80, TI-68k) + -f: get on-calc folder name (TI-68k) + -t: get variable type as integer (TI-Z80, TI-eZ80, TI-68k) + -h: get file magic number (8 bytes) + -V: get file version (TI-Z80, TI-eZ80) + -c: get file comment + -a: get file archived information (TI-Z80, TI-eZ80, TI-68k) + -l: get file locked information (TI-68k) + -C: get stored data checksum and computed data checksum + +OPTIONS for set mode may include (multiple options at a time): + -n NAME: set on-calc variable name to NAME (TI-Z80, TI-eZ80, TI-68k) + -f NAME: set on-calc folder name to NAME (TI-68k) + -t TYPE: set variable type to TYPE integer (TI-Z80, TI-eZ80, TI-68k) + -h MAGIC: set file magic number to MAGIC + -V VERSION: set file version to VERSION (TI-Z80, TI-eZ80) + -c COMMENT: set file comment to COMMENT + -a 0/1: set file archived information to 0/1 (TI-Z80, TI-eZ80, TI-68k) + -l 0/1: set file locked information to 0/1 (TI-68k) - note: archived implies locked + -C VALUE|fix: set stored data checksum to the given value, or compute the data checksum and set it as stored data checksum. +)x", (*argv)[0]); + return 1; +} + +static int tifileutil_metadata(int * argc, char *** argv, unsigned int offset) +{ + int ret; + + tifileutil_critical("%s: metadata not implemented yet.\n", (*argv)[0]); + + ret = 1; + + return ret; +} + +typedef struct +{ + const char * desc; + const char * scriptable_name; + uint32_t scriptable_name_len; + FNCT_MENU fnct; + FNCT_USAGE usage; +} menu_entry; + +static menu_entry fnct_menu[] = +{ +#define DEFINE_MENU_ENTRY(desc, method) \ + { desc, #method, sizeof(#method) - 1, tifileutil_##method, tifileutil_##method##_usage } +// Used for signaling that a newline should be printed +#define NULL_ENTRY \ + { nullptr, nullptr, 0, nullptr, nullptr } + + // IMPORTANT NOTES: for backwards compatibility, after a scriptable name was defined, it shall never be changed. + NULL_ENTRY, // 0 + { "Exit now", "exit", 4, nullptr, nullptr }, + DEFINE_MENU_ENTRY("Wrap data to variable", wrap), + DEFINE_MENU_ENTRY("Unwrap data from variable", unwrap), + DEFINE_MENU_ENTRY("Dump data from file", dump), + //DEFINE_MENU_ENTRY("Print or modify metadata", metadata), + NULL_ENTRY, +#undef NULL_ENTRY +#undef DEFINE_MENU_ENTRY +}; + +static int tifileutil_scan_parameters(int * argc, char *** argv) +{ + int ret = 0; + unsigned int choice = 0; + + // tipack compatibility mode. + if (!strcmp((*argv)[0], "tipack")) { + ret = tifileutil_wrap(argc, argv, 0U); + } + else if (*argc >= 2) { + if (!strcmp((*argv)[1], "-h") || !strcmp((*argv)[1], "--help")) { + goto print_usage; + } + else if (!strcmp((*argv)[1], "-v") || !strcmp((*argv)[1], "--version")) { + fputs(PACKAGE " " PACKAGE_VERSION "\n", stderr); + } + for (unsigned int i = 1; i < sizeof(fnct_menu) / sizeof(fnct_menu[0]); i++) { + if (nullptr != fnct_menu[i].scriptable_name) { + if (!strcmp((*argv)[1], fnct_menu[i].scriptable_name)) { + choice = i; + break; + } + } + } + if (choice != 0) { + if (nullptr != fnct_menu[choice].fnct) { + ret = (*fnct_menu[choice].fnct)(argc, argv, 0U); + } + else { + ret = 0; + } + } + else { + ret = 1; +print_usage: + fputs(PACKAGE " " PACKAGE_VERSION "\n", stderr); + for (unsigned int i = 1; i < sizeof(fnct_menu) / sizeof(fnct_menu[0]); i++) { + if (nullptr != fnct_menu[i].usage) { + (void)((*fnct_menu[i].usage)(argc, argv)); + } + } + } + } + else { + goto print_usage; + } + + return ret; +} + +static int tifileutil_init(int * argc, char *** argv) +{ + int ret = 0; + + /* Check the version of libraries and init framework */ + if (strcmp(ticonv_version_get(), TIFILEUTIL_REQUIRES_LIBTICONV_VERSION) < 0) + { + tifileutil_critical(_("libticonv library version is %s but %s mini required.\n"), ticonv_version_get(), TIFILEUTIL_REQUIRES_LIBTICONV_VERSION); + return 1; + } + + if (strcmp(tifiles_version_get(), TIFILEUTIL_REQUIRES_LIBTIFILES2_VERSION) < 0) + { + tifileutil_critical(_("libtifiles library version is %s but %s mini required.\n"), tifiles_version_get(), TIFILEUTIL_REQUIRES_LIBTIFILES2_VERSION); + return 1; + } + + tifiles_library_init(); + + /* Init i18n support */ +#if 0 // #ifdef ENABLE_NLS + tifileutil_info("setlocale: %s", setlocale(LC_ALL, "")); + tifileutil_info("bindtextdomain: %s", bindtextdomain(PACKAGE, LOCALEDIR)); + bind_textdomain_codeset(PACKAGE, "UTF-8"/*"ISO-8859-15"*/); + tifileutil_info("textdomain: %s", textdomain(PACKAGE)); +#endif + + ret = tifileutil_scan_parameters(argc, argv); + + return ret; +} + +static int tifileutil_exit() +{ + tifiles_library_exit(); + + return 0; +} + +int main(int argc, char ** argv) +{ + int ret; + +#ifdef ENABLE_NLS +// char * locale_dir = g_strconcat(SHARE_DIR, G_DIR_SEPARATOR_S, LOCALEDIR, "/", nullptr); +#endif + + // Force GLib 2.32+ to print info and debug messages like older versions did, unless this variable is already set. + // No effect on earlier GLib versions. + // Commented out because this interferes with stdout mode for e.g. dump. + //g_setenv("G_MESSAGES_DEBUG", "all", /* overwrite = */ FALSE); + + progname = argv[0]; + + ret = tifileutil_init(&argc, &argv); + + tifileutil_exit(); + + return ret; +} diff --git a/tifileutil/trunk b/tifileutil/trunk new file mode 120000 index 000000000..945c9b46d --- /dev/null +++ b/tifileutil/trunk @@ -0,0 +1 @@ +. \ No newline at end of file