fuse-utils-1.5.1/0000775000175000017500000000000015271234221012633 5ustar00fredmfredmfuse-utils-1.5.1/Makefile.am0000664000175000017500000001275715267623700014714 0ustar00fredmfredm## Process this file with automake to produce Makefile.in ## Copyright (c) 1999-2002 Philip Kendall ## Copyright (c) 2013-2015 Sergio Baldovi ## 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. ## ## Author contact information: ## ## E-mail: philip-fuse@shadowmagic.org.uk AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 bin_PROGRAMS = createhdf \ fmfconv \ listbasic \ mdrlist \ profile2map \ raw2hdf \ rzxdump \ rzxtool \ scl2trd \ snap2tzx \ snapconv \ snapdump \ tape2wav \ tapeconv \ tape2pulses \ tzxlist if BUILD_AUDIOTOOLS bin_PROGRAMS += audio2tape endif if BUILD_RZXCHECK bin_PROGRAMS += rzxcheck endif EXTRA_PROGRAMS = rzxcheck audio2tape AM_CPPFLAGS = $(LIBSPECTRUM_CFLAGS) $(GLIB_CFLAGS) createhdf_SOURCES = ide.c createhdf.c fmfconv_SOURCES = fmfconv.c \ fmfconv_compr.c \ fmfconv_types.c \ fmfconv_output/fmfconv_aiff.c \ fmfconv_output/fmfconv_au.c \ fmfconv_output/fmfconv_avi.c \ fmfconv_output/fmfconv_ppm.c \ fmfconv_output/fmfconv_scr.c \ fmfconv_output/fmfconv_wav.c \ fmfconv_output/fmfconv_yuv.c if COMPAT_GETOPT fmfconv_SOURCES += compat/getopt.c compat/getopt1.c endif if HAVE_LIBJPEG fmfconv_SOURCES += fmfconv_output/fmfconv_jpg.c endif if HAVE_LIBPNG fmfconv_SOURCES += fmfconv_output/fmfconv_png.c endif fmfconv_LDADD = $(JPEG_LIBS) $(PNG_LIBS) compat/libcompatos.a listbasic_SOURCES = listbasic.c utils.c listbasic_LDADD = $(LIBSPECTRUM_LIBS) compat/libcompatos.a mdrlist_SOURCES = mdrlist.c utils.c mdrlist_LDADD = $(LIBSPECTRUM_LIBS) compat/libcompatos.a profile2map_SOURCES = profile2map.c utils.c profile2map_LDADD = $(LIBSPECTRUM_LIBS) compat/libcompatos.a raw2hdf_SOURCES = ide.c raw2hdf.c rzxcheck_SOURCES = rzxcheck.c keys.c utils.c rzxcheck_LDADD = $(LIBSPECTRUM_LIBS) compat/libcompatos.a rzxdump_SOURCES = rzxdump.c utils.c rzxdump_LDADD = $(LIBSPECTRUM_LIBS) compat/libcompatos.a rzxtool_SOURCES = rzxtool.c utils.c rzxtool_LDADD = $(LIBSPECTRUM_LIBS) compat/libcompatos.a scl2trd_SOURCES = scl2trd.c snap2tzx_SOURCES = snap2tzx.c utils.c snap2tzx_LDADD = $(LIBSPECTRUM_LIBS) compat/libcompatos.a snapconv_SOURCES = snapconv.c utils.c snapconv_LDADD = $(LIBSPECTRUM_LIBS) compat/libcompatos.a snapdump_SOURCES = snapdump.c utils.c snapdump_LDADD = $(LIBSPECTRUM_LIBS) compat/libcompatos.a tapeconv_SOURCES = tapeconv.c utils.c tapeconv_LDADD = $(LIBSPECTRUM_LIBS) compat/libcompatos.a tzxlist_SOURCES = tzxlist.c utils.c tzxlist_LDADD = $(LIBSPECTRUM_LIBS) $(LTLIBICONV) compat/libcompatos.a audio2tape_SOURCES = audio2tape.cc importer/soundfile.cc importer/trigger.cc \ converter/findpilot.cc converter/findsync1.cc \ converter/getpulse1.cc converter/getpulse2.cc \ converter/getsync2.cc converter/romloader.cc \ converter/romloaderstate.cc utils.c audio2tape_CPPFLAGS = $(AM_CPPFLAGS) $(AUDIOFILE_CFLAGS) audio2tape_LDADD = $(LIBSPECTRUM_LIBS) $(AUDIOFILE_LIBS) \ compat/libcompatos.a tape2wav_SOURCES = tape2wav.c utils.c tape2wav_LDADD = $(LIBSPECTRUM_LIBS) \ compat/libcompatos.a tape2pulses_SOURCES = tape2pulses.c utils.c tape2pulses_LDADD = $(LIBSPECTRUM_LIBS) compat/libcompatos.a noinst_HEADERS = compat.h ide.h utils.h audio2tape.h importer/interpolator.h \ importer/schmitt.h importer/simple.h importer/soundfile.h \ importer/trigger.h converter/findpilot.h \ converter/findsync1.h converter/getpulse1.h \ converter/getpulse2.h converter/getsync2.h \ converter/romloader.h converter/romloaderstate.h \ compat/getopt.h fmfconv.h fmfconv_compr.h fmfconv_types.h \ movie_tables.h noinst_LIBRARIES = EXTRA_DIST = \ update-release.py \ .agents/skills/README.md \ .agents/skills/update-changelog/SKILL.md include compat/Makefile.am include hacking/Makefile.am include m4/Makefile.am include man/Makefile.am include tests/Makefile.am ## Resources for Windows executables if HAVE_WINDRES audio2tape_SOURCES += audio2tape_res.rc createhdf_SOURCES += createhdf_res.rc fmfconv_SOURCES += fmfconv_res.rc listbasic_SOURCES += listbasic_res.rc mdrlist_SOURCES += mdrlist_res.rc profile2map_SOURCES += profile2map_res.rc raw2hdf_SOURCES += raw2hdf_res.rc rzxcheck_SOURCES += rzxcheck_res.rc rzxdump_SOURCES += rzxdump_res.rc rzxtool_SOURCES += rzxtool_res.rc scl2trd_SOURCES += scl2trd_res.rc snap2tzx_SOURCES += snap2tzx_res.rc snapconv_SOURCES += snapconv_res.rc snapdump_SOURCES += snapdump_res.rc tape2pulses_SOURCES += tape2pulses_res.rc tape2wav_SOURCES += tape2wav_res.rc tapeconv_SOURCES += tapeconv_res.rc tzxlist_SOURCES += tzxlist_res.rc .rc.o: $(AM_V_GEN)$(WINDRES) -I$(srcdir) -I$(top_builddir) $(LIBSPECTRUM_CFLAGS) $(CPPFLAGS) -o $@ $< endif fuse-utils-1.5.1/createhdf_res.rc0000664000175000017500000000365515157611610015774 0ustar00fredmfredm/* createhdf_res.rc: resources for Windows executable Copyright (c) 2015 Sergio Baldovi 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. Author contact information: E-mail: serbalgi@gmail.com */ #include "config.h" #include /* VERSIONINFO specs: http://msdn.microsoft.com/en-us/library/aa381058%28VS.85%29.aspx */ VS_VERSION_INFO VERSIONINFO FILEVERSION FUSE_UTILS_RC_VERSION PRODUCTVERSION FUSE_UTILS_RC_VERSION FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0x0L FILEOS VOS__WINDOWS32 FILETYPE VFT_APP FILESUBTYPE VFT2_UNKNOWN BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904B0" BEGIN VALUE "CompanyName", "\0" VALUE "FileDescription", "Create blank IDE hard disk image in HDF format\0" VALUE "FileVersion", VERSION##"\0" VALUE "InternalName", "createhdf\0" VALUE "LegalCopyright", "Copyright (c) 2004-2006 Philip Kendall\0" VALUE "License", "createhdf is licensed under the GNU General Public License, version 2 or later\0" VALUE "OriginalFilename", "createhdf.exe\0" VALUE "ProductName", PACKAGE##"\0" VALUE "ProductVersion", VERSION##"\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1252 END END fuse-utils-1.5.1/snap2tzx_res.rc0000664000175000017500000000373515157611610015637 0ustar00fredmfredm/* snap2tzx_res.rc: resources for Windows executable Copyright (c) 2015 Sergio Baldovi 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. Author contact information: E-mail: serbalgi@gmail.com */ #include "config.h" #include /* VERSIONINFO specs: http://msdn.microsoft.com/en-us/library/aa381058%28VS.85%29.aspx */ VS_VERSION_INFO VERSIONINFO FILEVERSION FUSE_UTILS_RC_VERSION PRODUCTVERSION FUSE_UTILS_RC_VERSION FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0x0L FILEOS VOS__WINDOWS32 FILETYPE VFT_APP FILESUBTYPE VFT2_UNKNOWN BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904B0" BEGIN VALUE "CompanyName", "\0" VALUE "FileDescription", "Convert ZX Spectrum snapshot to .tzx tape images\0" VALUE "FileVersion", VERSION##"\0" VALUE "InternalName", "snap2tzx\0" VALUE "LegalCopyright", "Copyright (c) 1997-2001 ThunderWare Research Center, 2003 Tomaz Kac, 2003 Philip Kendall\0" VALUE "License", "snap2tzx is licensed under the GNU General Public License, version 2 or later\0" VALUE "OriginalFilename", "snap2tzx.exe\0" VALUE "ProductName", PACKAGE##"\0" VALUE "ProductVersion", VERSION##"\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1252 END END fuse-utils-1.5.1/fmfconv_compr.h0000664000175000017500000000267015157611610015653 0ustar00fredmfredm/* fmfconv_compr.h: Convert .fmf movie files - zlib compression routines Copyright (c) 2004-2015 Gergely Szasz Copyright (c) 2014-2016 Sergio Baldovi 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. Author contact information: E-mail: szaszg@hu.inter.net */ #ifndef FMFCONV_COMPR_H #define FMFCONV_COMPR_H #include "config.h" #include #ifdef HAVE_ZLIB_H int feof_compr( FILE *f ); int fgetc_compr( FILE *f ); int fread_compr( void *buff, size_t n, size_t m, FILE *f ); void fmf_compr_init( void ); void fmf_compr_end( void ); #else /* HAVE_ZLIB_H */ #define fgetc_compr fgetc #define fread_compr fread #define feof_compr feof #endif /* HAVE_ZLIB_H */ int fget_word(FILE *input); extern int fmf_compr; /* fmf compressed or not */ #endif /* #ifndef FMFCONV_COMPR_H */ fuse-utils-1.5.1/fmfconv.c0000664000175000017500000017642715251640540014461 0ustar00fredmfredm/* fmfconv.c: Convert .fmf movie files Copyright (c) 2004-2015 Gergely Szasz Copyright (c) 2014-2016 Sergio Baldovi 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. Author contact information: E-mail: szaszg@hu.inter.net */ #include "config.h" #include #include #include #include #include #include #include #ifdef HAVE_SIGNAL #include #endif /* #ifdef HAVE_SIGNAL */ #ifdef HAVE_STRINGS_H #include /* Needed for strncasecmp() on QNX6 */ #endif /* #ifdef HAVE_STRINGS_H */ #include #include #ifdef HAVE_ZLIB_H #include #else #define Z_NO_COMPRESSION 0 #define Z_BEST_SPEED 1 #define Z_DEFAULT_COMPRESSION 6 #define Z_BEST_COMPRESSION 9 #endif #include "libspectrum.h" #include "compat.h" #include "fmfconv.h" #include "fmfconv_compr.h" #include "movie_tables.h" #define PROGRAM_NAME "fmfconv" #define VERBOSE_MAX 3 #define VERBOSE_MIN -1 const char *progname; #ifdef USE_LIBJPEG extern int jpg_dctfloat; extern int jpg_idctfast; extern int jpg_optimize; extern int jpg_smooth; extern int jpg_quality; #endif int png_palette = -1; #ifdef USE_LIBPNG extern int png_compress; #endif #if defined USE_LIBJPEG || defined USE_LIBPNG int progressive = 0; #endif int greyscale = 0; int avi_subtype = -1; /* fmfconv guess */ typedef enum { DO_FILE = 0, /* open (next) file */ DO_HEAD, /* read and check file header (FMF) */ DO_FRAME_HEAD, /* a video frame ready */ DO_SLICE, /* read next slice or sound chunk */ DO_SOUND, /* a sound chunk ready */ DO_SOUND_FLUSH, /* a sound chunk ready but flush sound buffer */ DO_FRAME, /* a video frame ready */ DO_LAST_FRAME, /* last video frame ready */ DO_EOP, /* end of input(s) */ } do_t; int help_exit = 0; /* exit after print help */ int verbose = 0; int do_info = 0; /* no output and verbose 2 */ do_t do_now = DO_FILE; int fmfconv_stop = 0; FILE *inp_file = NULL, *out = NULL, *snd = NULL; int out_to_stdout = 0; type_t inp_t = TYPE_UNSET, out_t = TYPE_UNSET, snd_t = TYPE_UNSET, prg_t = TYPE_NONE; fmf_screen_type scr_t; const char *inp_name = NULL; const char *out_name = NULL; const char *snd_name = NULL; int overwr_out = 0; char out_tmpl[16]; /* multiple out filename number template */ const char *out_orig = NULL; /* multiple out original filename/template */ const char *out_pfix = NULL; /* after number */ char *out_nmbr = NULL; /* start of number */ char *out_next = NULL; /* multiple out filename next name */ libspectrum_qword cut_frm = 0, cut__to = 0; type_t cut_f_t, cut_t_t, cut_cmd = TYPE_NONE; int cut_cut = 0; char *out_cut = NULL; int inp_ftell = 0; int sound_exists = 0; /* FMF frame without sound */ libspectrum_qword input_no = 0; /* current file (input) no */ libspectrum_qword input_last_no = 0; /* number of files (input) - 1 */ int inp_fps = 50000; long int inp_drop_value = 0; int machine_timing[] = { /* timing constants for different machines */ 50080, 50021, 60115, 50000, 59651 }; int machine_ftime[] = { 19968, 19992, 16635, 20000, 16764 }; #define SCR_PITCH 40 libspectrum_byte zxscr[9600 * 2]; /* 2x 40x240 bitmap1 bitmap2 */ libspectrum_byte attrs[9600]; /* 40x240 attrib */ #define SOUND_CHUNK_LEN 8192 libspectrum_signed_byte *sound8; /* sound buffer for x-law */ libspectrum_signed_word *sound16; /* sound buffer for pcm */ size_t sound_buf_len = 0; libspectrum_byte yuv_pal[] = { 0, 128, 128, 22, 224, 112, 57, 96, 224, 79, 191, 208, 112, 65, 48, 134, 160, 32, 169, 32, 144, 191, 128, 128, 0, 128, 128, 29, 255, 107, 76, 85, 255, 105, 212, 235, 150, 44, 21, 179, 171, 0, 226, 0, 149, 255, 128, 128, }; libspectrum_byte rgb_pal[] = { 0, 0, 0, 0, 0, 192, 192, 0, 0, 192, 0, 192, 0, 192, 0, 0, 192, 192, 192, 192, 0, 192, 192, 192, 0, 0, 0, 0, 0, 255, 255, 0, 0, 255, 0, 255, 0, 255, 0, 0, 255, 255, 255, 255, 0, 255, 255, 255, }; type_t yuv_t = TYPE_420M; #define OUT_PITCH 320 libspectrum_byte pix_rgb[3 * 40 * 8 * 240 * 4]; /* bpp = 3; w = 40*8 h = 240 timex = 2*2 */ libspectrum_byte *pix_yuv[3] = { /* other view of data */ pix_rgb, NULL, NULL }; libspectrum_qword frame_no = 0; /* current frame (input) no */ libspectrum_qword time_sec = 0, time_frm = 0; /* current time (input) no */ libspectrum_qword drop_no = 0; /* dropped frame no */ libspectrum_qword dupl_no = 0; /* duplicated frame no */ libspectrum_qword output_no = 0; /* output frame no */ int frm_scr = 0, frm_rte = 0; /* screen type, frame rate */ fmf_machine_type frm_mch; /* machine type (A/B/C/D) */ int frm_slice_x, frm_slice_y, frm_slice_w, frm_slice_h; int frm_w = -1, frm_h = -1; int out_w, out_h; int out_fps = 0; /* desired output frame rate */ int out_header_ok = 0; /* output header ok? */ int out_chn = 2, out_rte = -1, out_fsz, out_len; /* by default convert sound to 2 channel (STEREO) */ /* fmf variables */ int fmf_little_endian = 0; /* little endian PCM */ int snd_little_endian = -1; /* little endian PCM */ libspectrum_qword fmf_slice_no = 0; libspectrum_qword fmf_sound_no = 0; /* sound variables */ #define SOUND_BUFF_MAX_SIZE 65536 /* soft max size of collected sound samples */ fmf_sound_type snd_enc; /* sound type (pcm/alaw) */ int snd_rte, snd_chn, snd_fsz, snd_len; /* sound rate (Hz), sound channels (1/2), sound length in byte */ int snd_frg = 0; /* sound fragment len from previous resample in bytes */ int snd_header_ok = 0; /* sound header ok? */ int sound_raw = 0; /* do not do law->PCM and channels conversion */ int sound_pcm = 1; /* by default always convert sound to PCM */ int sound_stereo = 1; /* by default always convert sound to STEREO */ int sound_only = 0; /* by default process video */ libspectrum_signed_word alaw_table[256] = { ALAW_TAB }; libspectrum_byte fhead[32]; /* fmf file/frame/slice header */ #define FBUFF_SIZE 32 libspectrum_byte fbuff[FBUFF_SIZE]; /* file buffer used for check file type... */ size_t fbuff_size = 0; #define INTO_BUFF 0 #define FROM_BUFF 1 FILE * fopen_overwr( const char *path, const char *mode, int rw ) { if( overwr_out ) return fopen( path, mode ); #ifdef HAVE_FDOPEN int fd; fd = open( path, ( rw ? O_RDWR : O_WRONLY ) | O_EXCL | O_CREAT | O_BINARY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH ); if( fd >= 0 ) return fdopen( fd, mode ); else return NULL; #else if( access( path, F_OK ) == 0 ) return NULL; return fopen( path, mode ); #endif } static size_t fread_buff( libspectrum_byte *ptr, size_t size, int how ) /* read from inp, how -> into buff or buff + file */ { size_t s; size_t n; if( how == INTO_BUFF ) { n = size > FBUFF_SIZE ? FBUFF_SIZE : size; s = fread( fbuff, n, 1, inp_file ); if( s != 1 ) return s; fbuff_size = n; memcpy( ptr, fbuff, n ); if( size > FBUFF_SIZE ) { ptr += n; n = size - FBUFF_SIZE; return fread( ptr, n, 1, inp_file ); } } else { n = size <= fbuff_size ? size : fbuff_size; if( n > 0 ) { memcpy( ptr, fbuff, n ); if( n < fbuff_size ) memmove( fbuff, fbuff + n, fbuff_size - n ); fbuff_size -= n; size -= n; ptr += n; } if( size > 0 ) { return fread( ptr, size, 1, inp_file ); } } return 1; } libspectrum_dword swap_endian_dword( libspectrum_dword d ) { return ( ( d & 0x000000ff ) << 24 ) | ( ( d & 0x0000ff00 ) << 8 ) | ( ( d & 0x00ff0000 ) >> 8 ) | ( d >> 24 ); } static int alloc_sound_buff( size_t len ) { libspectrum_signed_byte *ptr = NULL; if( sound_buf_len < len ) { len = ( ( len * 3 / 2 ) / SOUND_CHUNK_LEN + 1 ) * SOUND_CHUNK_LEN; if( sound_buf_len == 0 ) { sound8 = malloc( len ); } else { ptr = sound8; sound8 = realloc( sound8, len ); } if( sound8 == NULL ) { printe( "\n\nMemory (re)allocation error.\n" ); free( ptr ); return ERR_OUTOFMEM; } sound16 = (void *)sound8; sound_buf_len = len; printi( 3, "fmf_alloc_sound(): sound buffer length: %lu\n", (unsigned long)sound_buf_len ); } return 0; } static int law_2_pcm( void ) { int err; libspectrum_signed_byte *s; libspectrum_signed_word *t; if( snd_t == TYPE_NONE ) return 0; /* we have to deal resample fragment space */ if( ( err = alloc_sound_buff( snd_frg + snd_len * 2 ) ) ) return err; /* we have to skip resample fragment space */ sound8 += snd_frg; sound16 = (void *)sound8; for( s = sound8 + snd_len - 1, t = sound16 + snd_len - 1; s >= sound8 + snd_frg; s--, t-- ) { *t = alaw_table[*(libspectrum_byte*)s]; } /* restore pointers */ sound8 -= snd_frg; sound16 = (void *)sound8; #ifdef WORDS_BIGENDIAN snd_little_endian = 0; #else snd_little_endian = 1; #endif snd_enc = PCM; snd_fsz <<= 1; /* 1byte -> 2byte */ snd_len <<= 1; /* 1byte -> 2byte */ printi( 3, "law_2_pcm(): %d sample converted\n", snd_len / 2 ); return 0; } void pcm_swap_endian( void ) /* buff == sound */ { libspectrum_word *s; int len = snd_len / 2; for( s = (void *)sound16; len > 0; len-- ) { *s = ( ( *s & 0x00ff ) << 8 ) | ( *s >> 8 ); s++; } printi( 3, "pcm_swap_endian(): %d sample converted\n", snd_len / 2 ); } /* [1][2][3][4][5] -> [1][2][3][4][5][ ][ ][ ][5][5][6][6] -> [1][1][2][2][3][3][4][4][5][5][6][6] */ static int mono_2_stereo( void ) { int err; if( snd_t == TYPE_NONE ) return 0; if( ( err = alloc_sound_buff( snd_len * 2 ) ) ) return err; if( snd_enc == PCM ) { libspectrum_signed_word *s; libspectrum_signed_word *t; for( s = sound16 + snd_len / 2 - 1, t = sound16 + snd_len - 1 ; s >= sound16; s--, t-- ) { *t = *s; t--; *t = *s; } } else { libspectrum_signed_byte *s; libspectrum_signed_byte *t; for( s = sound8 + snd_len - 1, t = sound8 + 2 * snd_len - 1 ; s >= sound8; s--, t-- ) { *t = *s; t--; *t = *s; } } snd_chn = 2; snd_fsz <<= 1; /* 1/2byte -> 2/4byte */ snd_len <<= 1; /* 1/2byte -> 2/4byte */ printi( 3, "mono_2_stereo(): %d sample converted (%d)\n", snd_len / snd_fsz, snd_len ); return 0; } /* [1][1][2][2][3][3][4][4][5][5][6][6] -> [1][2][3][4][5][ ][ ][ ][5][5][6][6] -> [1][2][3][4][5] */ static int stereo_2_mono( void ) { void *buff_end; if( snd_t == TYPE_NONE ) return 0; /* we have to skip resample fragment space */ sound8 += snd_frg; sound16 = (void *)sound8; if( snd_enc == PCM ) { libspectrum_signed_word *s; libspectrum_signed_word *t; buff_end = sound16 + snd_len / 2; for( s = t = sound16; (void *)s < buff_end; s++, t++ ) { *t = *s; s++; *t = ( (libspectrum_signed_dword)*t + *s + 1 ) / 2; } } else { libspectrum_signed_byte *s; libspectrum_signed_byte *t; buff_end = sound16 + snd_len; for( s = t = sound8; (void *)s < buff_end; s++, t++ ) { *t = *s; s++; *t = ( (libspectrum_signed_dword)*t + *s + 1 ) / 2; } } /* restore pointers */ sound8 -= snd_frg; sound16 = (void *)sound8; snd_chn = 1; snd_fsz >>= 1; /* 1/2byte -> 2/4byte */ snd_len >>= 1; /* 1/2byte -> 2/4byte */ printi( 3, "stereo_2_mono(): %d sample converted (%d)\n", snd_len / snd_fsz, snd_len ); return 0; } /* [;;;;; /^^^^\______/] ^ ^ ^ | | | sbuf snd_frg snd_r fmf_rte snd_rte out_rte */ static int resample_sound( void ) { int err, nsamples; static int fmf_rte = -1; static int snd_cpy = 0; static int last_l = 0, last_r = 0; size_t new_len; libspectrum_signed_byte *snd8_w, *snd8_r; libspectrum_signed_word *snd16_w, *snd16_r; if( snd_t == TYPE_NONE ) return 0; snd16_r = snd16_w = sound16; snd8_r = snd8_w = sound8; if( out_rte > snd_rte ) { /* move samples to upper part */ new_len = snd_len + snd_fsz; new_len = new_len * out_rte / snd_rte + snd_frg; if( ( err = alloc_sound_buff( new_len ) ) ) return err; snd8_r = snd8_r + new_len - snd_len; memmove( snd8_r, sound8 + snd_frg, snd_len ); snd16_r = (void *)snd8_r; if( snd_enc == PCM ) snd16_w += snd_cpy * snd_chn; else snd8_w += snd_cpy * snd_chn; } /* rescale last copied samples (fragment) */ fmf_rte -= out_rte - snd_rte; nsamples = snd_len / snd_fsz; while( nsamples-- ) { if( snd_cpy ) { /* [---- ######] [lrlrlr] */ int n = snd_cpy + 1; if( snd_enc == PCM ) snd16_w -= snd_cpy * snd_chn; else snd8_w -= snd_cpy * snd_chn; while( snd_cpy ) { if( snd_enc == PCM ) { *snd16_w = last_l + (*snd16_r - last_l) * (n - snd_cpy) / n; snd16_w++; } else { *snd8_w = last_l + (*snd8_r - last_l) * (n - snd_cpy) / n; snd8_w++; } if( snd_chn == 2 ) { if( snd_enc == PCM ) { *snd16_w = last_r + (*(snd16_r+1) - last_r) * (n - snd_cpy) / n; snd16_w++; } else { *snd8_w = last_r + (*(snd8_r+1) - last_r) * (n - snd_cpy) / n; snd8_w++; } } snd_cpy--; } } while( fmf_rte <= 0 ) { if( snd_enc == PCM ) { if( snd16_w != snd16_r ) *snd16_w = *snd16_r; /* really we do not need to store copies ... */ snd16_w++; } else { if( snd8_w != snd8_r ) *snd8_w = *snd8_r; snd8_w++; } if( snd_chn == 2 ) { if( snd_enc == PCM ) { if( snd16_w != snd16_r + 1 ) *snd16_w = *(snd16_r + 1); snd16_w++; } else { if( snd8_w != snd8_r + 1 ) *snd8_w = *(snd8_r + 1); snd8_w++; } } fmf_rte += snd_rte; snd_cpy++; } if( snd_enc == PCM ) { last_l = last_r = *snd16_r; snd16_r++; } else { last_l = last_r = *snd8_r; snd8_r++; } if( snd_chn == 2 ) { if( snd_enc == PCM ) { last_r = *snd16_r; snd16_r++; } else { last_r = *snd8_r; snd8_r++; } } fmf_rte -= out_rte; if( snd_cpy ) snd_cpy--; } snd_frg = snd_cpy * snd_fsz; new_len = ( snd_enc == PCM ? (void *)snd16_w : (void *)snd8_w ) - (void *)sound8; new_len -= snd_frg; printi( 3, "resample_sound(): %d sample converted to %ld (%dHz -> %dHz)\n", snd_len / snd_fsz, new_len / snd_fsz, snd_rte, out_rte ); snd_len = new_len; fmf_rte += out_rte - snd_rte; return 0; } static const char * find_filename_ext( const char *filename ) { const char *extension = NULL; /* Get the filename extension, if it exists */ if( filename ) { extension = strrchr( filename, '.' ); if( extension ) extension++; } return extension; } static int inp_get_cut_value( char *s, libspectrum_qword *value, type_t *type ) { int n = 0; libspectrum_qword frm = 0; char *tmp = strchr( s, ':' ); if( tmp ) { /*OK, min:sec */ unsigned int sec = 0; if( ( sscanf( s, "%"PRIu64":%n%u", &frm, &n, &sec) != 2 ) || sec > 59 ) { /* OK, unknown value.. */ printe( "Bad interval definition in a -C/--cut option\n" ); return 6; } frm = frm * 60 + sec; *value = frm; *type = TYPE_TIME; return 0; } if( ( sscanf( s, "%"PRIu64, &frm) != 1 ) ) { /* OK, unknown value.. */ printe( "Bad interval definition in a -C/--cut option\n" ); return 6; } *value = frm; *type = TYPE_FRAME; return 0; } static int inp_get_next_cut( void ) { char *mns, *tmp; int err; cut_cut = 0; if( !out_cut || *out_cut == '\0' ) { /* End of cut!!! */ cut_cmd = TYPE_NONE; return 0; } tmp = strchr( out_cut, ',' ); if( tmp ) *(tmp++) = '\0'; /*Ok, we start the first intervall */ mns = strchr( out_cut, '-' ); /* ff[:ss] */ if( !mns ) { /* there is no '-' one frame/sec cut out*/ if( ( err = inp_get_cut_value( out_cut, &cut_frm, &cut_f_t ) ) ) return err; cut__to = cut_frm; cut_t_t = cut_f_t; cut_cmd = TYPE_CUT; } else if( out_cut == mns ) { /* -ff[:ss]*/ cut_frm = 0; cut_f_t = TYPE_FRAME; if( ( err = inp_get_cut_value( out_cut + 1, &cut__to, &cut_t_t ) ) ) return err; cut_cmd = TYPE_CUT; } else { /* xx-xx or xx- */ mns++; if( ( err = inp_get_cut_value( out_cut, &cut_frm, &cut_f_t ) ) ) return err; if( *mns == '\0' ) { /* xxx- */ /* if( ( err = inp_get_cut_value( out_cut + 1, &cut_frm, &cut_f_t ) ) ) return err; */ cut__to = 0; cut_cmd = TYPE_CUTFROM; } else { if( ( err = inp_get_cut_value( mns, &cut__to, &cut_t_t ) ) ) return err; /* xxx-yyy */ cut_cmd = TYPE_CUT; } } out_cut = tmp; return 0; } /* %[flags] [width] [.precision] [{h | l | ll | I | I32 | I64}]type %[0 ][0-9]* %08d -> %08llu */ static int parse_outname( void ) { const char *f = out_name, *perc; char c1[2], c2[2]; int n, len; perc = f; out_orig = out_name; while( f && *f ) { while( ( perc = strchr( f, '%' ) ) != NULL && *( perc + 1 ) == '%' ) { f = perc + 1; } f = perc; if( !f ) break; if( sscanf( perc, "%%%1[0 ]%2u%1[dxXou]%n", c1, &n, c2, &len ) == 3 ) { break; } else if( sscanf( perc, "%%%2u%1[dxXou]%n", &n, c2, &len ) == 2 ) { c1[0] = '\0'; break; } else if( sscanf( perc, "%%%1[dxXou]%n", c2, &len ) == 1 ) { n = 0; c1[0] = '\0'; break; } else { f++; } } out_next = malloc( strlen( out_name ) + 24 ); if( f == NULL ) { /* there is no number template */ const char *ext; ext = find_filename_ext( out_name ); if( ext == NULL ) { strcpy( out_tmpl, "-%08u" ); out_nmbr = out_next + strlen( out_name ); out_pfix = NULL; } else { strcpy( out_tmpl, "-%08u" ); out_nmbr = out_next + ( ext - out_name - 1 ); out_pfix = ext - 1; } } else { if( n > 20 ) n = 20; if( c2[0] == 'd' ) c2[0] = 'u'; if( n ) sprintf( out_tmpl, "%%%s%ull%c", c1, n, c2[0] ); else sprintf( out_tmpl, "%%%sll%c", c1, c2[0] ); out_nmbr = out_next + ( perc - out_name ); out_pfix = perc + len; } printi( 2, "parse_outname(): Multiple output file No. template: %s.\n", out_tmpl ); return 0; } int next_outname( libspectrum_qword num ) { int err; if( !out_orig && ( err = parse_outname() ) ) return err; strcpy( out_next, out_orig ); sprintf( out_nmbr, out_tmpl, num ); if( out_pfix ) strcat( out_next, out_pfix ); out_name = out_next; printi( 3, "next_outname(): Next generated output filename: %s.", out_name ); return 0; } int open_out( void ) { const char *ext; typedef struct { type_t type; const char *extension; } ext_t; int i, err; ext_t out_ext_tab[] = { { TYPE_WAV, "wav" }, { TYPE_AU, "au" }, { TYPE_AU, "snd" }, { TYPE_AIFF, "aif" }, { TYPE_AIFF, "aiff" }, { TYPE_YUV, "yuv" }, { TYPE_YUV, "y4m" }, { TYPE_SCR, "scr" }, { TYPE_PPM, "ppm" }, { TYPE_PPM, "pnm" }, #ifdef USE_LIBPNG { TYPE_PNG, "png" }, #endif #ifdef USE_LIBJPEG { TYPE_JPEG, "jpg" }, { TYPE_JPEG, "jpeg" }, { TYPE_MJPEG,"mjpeg" }, #endif { TYPE_AVI, "avi" }, { 0, NULL } }; const char *out_tstr[] = { "SCR - ZX Spectrum screenshot file", "PPM - Portable PixMap", "PNG - Portable Network Graphics", "JPEG - Joint Photographic Experts Group file format", "M-JPEG - Motion JPEG video file", "AVI - Microsoft Audio Video Interleave format", "YUV4MPEG2 - uncompressed video stream format", "FFMPEG - ffmpeg file format" }; if( do_info ) return 0; if( out_t == TYPE_NONE ) return 0; if( out_name && out_t == TYPE_UNSET ) { /* try to identify the file type */ out_t = TYPE_AVI; /* default to AVI */ ext = find_filename_ext( out_name ); for( i = 0; ext != NULL && out_ext_tab[i].extension != NULL; i++ ) { if( !strcasecmp( ext, out_ext_tab[i].extension ) ) { out_t = out_ext_tab[i].type; break; } } } if( out_t >= TYPE_WAV && out_t <= TYPE_AIFF ) { sound_only = 1; out_t = TYPE_NONE; snd_name = out_name; out_name = NULL; return 0; } if( out_name && ( out_t >= TYPE_SCR && out_t <= TYPE_JPEG ) && ( err = next_outname( output_no ) ) > 0 ) return err; /* default out fps PAL */ if( out_t >= TYPE_MJPEG && out_t <= TYPE_FFMPEG && out_fps == 0 ) out_fps = 25000; if( out_name ) { if( ( out = fopen_overwr( out_name, "wb", 0 ) ) == NULL ) { printe( "Cannot open output file '%s' (%s)...\n", out_name, strerror( errno ) ); return ERR_OPEN_OUT; } #ifdef USE_LIBJPEG if( avi_subtype == -1 ) avi_subtype = TYPE_AVI; #endif } else { if( isatty( fileno( stdout ) ) ) { out_t = TYPE_NONE; out = NULL; out_name = "(-=null=-)"; } else { if( out_t != TYPE_YUV && out_t != TYPE_MJPEG ) { out_t = TYPE_AVI; /* default to AVI */ } out = stdout; out_to_stdout = 1; out_name = "(-=stdout=-)"; #ifdef WIN32 setmode( fileno( stdout ), O_BINARY ); #endif /* #ifdef WIN32 */ } } #ifdef USE_LIBPNG if( out_t == TYPE_PNG && png_palette < 0 ) png_palette = 1; #endif if( out_t == TYPE_NONE ) { printi( 0, "open_out(): Output is a terminal, cannot dump binary data.\n" ); } else if( !( out_t >= TYPE_SCR && out_t <= TYPE_JPEG ) ) { printi( 0, "open_out(): Output file (%s) opened as %s file.\n", out_name, out_tstr[out_t - TYPE_SCR] ); } else { if( !output_no ) printi( 0, "open_out(): Multiple output file (%s) as %s.\n", out_next, out_tstr[out_t - TYPE_SCR] ); printi( 2, "open_out(): Output file (%s) opened as %s file.\n", out_name, out_tstr[out_t - TYPE_SCR] ); } if( avi_subtype == -1 ) avi_subtype = TYPE_AVI_DIB; /* convert rgb palette to bgr */ if( out_t == TYPE_AVI && avi_subtype == TYPE_AVI_DIB && !greyscale ) { libspectrum_byte r; printi( 3, "Converting RGB palette to BGR for Microsoft AVI/DIB format.\n" ); for( i = 0; i < 16; i ++ ) { r = rgb_pal[ i * 3 ]; rgb_pal[ i * 3 ] = rgb_pal[ i * 3 + 2 ]; rgb_pal[ i * 3 + 2 ] = r; } } return 0; } static int open_snd( void ) { const char *ext; typedef struct { type_t type; const char *extension; } ext_t; int i; ext_t snd_ext_tab[] = { { TYPE_WAV, "wav" }, { TYPE_AU, "au" }, { TYPE_AU, "snd" }, { TYPE_AIFF, "aif" }, { TYPE_AIFF, "aiff" }, { 0, NULL } }; const char *snd_tstr[] = { "FFMPEG - ffmpeg file format", "WAV - MS Wave file format", "AU - SUN OS audio file format", "AIF - MAC/OS audio file format" }; if( do_info ) return 0; if( snd_name ) { if( ( snd = fopen_overwr( snd_name, "wb", 0 ) ) == NULL ) { printe( "Cannot open sound file '%s' (%s)...\n", snd_name, strerror( errno ) ); return ERR_OPEN_SND; } } else if( out_t == TYPE_AVI ) { /* AVI video and audio if nothing else specified */ snd_t = TYPE_AVI; return 0; } else { snd_t = TYPE_NONE; return 0; } if( snd_t == TYPE_UNSET ) { /* try to identify the file type */ snd_t = TYPE_WAV; /* default to WAV */ ext = find_filename_ext( snd_name ); for( i = 0; ext != NULL && snd_ext_tab[i].extension != NULL; i++ ) { if( !strcasecmp( ext, snd_ext_tab[i].extension ) ) { snd_t = snd_ext_tab[i].type; break; } } } printi( 0, "open_snd(): Sound file (%s) opened as %s file.\n", snd_name, snd_tstr[snd_t - TYPE_FFMPEG] ); return 0; } static int open_inp( void ) { if( inp_file ) { /* we have to close before last */ if( inp_file != stdin ) { fclose( inp_file ); } else { /* reopen stdin???? */ do_now = DO_EOP; return 0; } } if( inp_name ) { if( ( inp_file = fopen( inp_name, "rb" ) ) == NULL ) { printe( "Cannot open input file '%s'...\n", inp_name ); return ERR_OPEN_INP; } } else if( out_t == TYPE_AVI ) { /* AVI video and audio */ snd_t = TYPE_AVI; return 0; } else { inp_file = stdin; inp_name = "(-=stdin=-)"; } if( fseek( inp_file, 0, SEEK_END ) == -1 ) { printi( 4, "open_inp(): cannot seek to the end of the input file (not seekable).\n" ); inp_ftell = 0; } else if( ( inp_ftell = ftell( inp_file ) ) == -1 ) { printi( 4, "open_inp(): cannot ftell input file??.\n" ); fseek( inp_file, 0, SEEK_SET ); inp_ftell = 0; } else { fseek( inp_file, 0, SEEK_SET ); } if( inp_t == TYPE_UNSET ) { /* try to identify the file type */ fread_buff( fhead, 4, INTO_BUFF ); /* check file type */ if( memcmp( fhead, "FMF_", 4 ) != 0 ) { printe( "Cannot identify input file '%s'...\n", inp_name ); return ERR_OPEN_INP; } inp_t = TYPE_FMF; } do_now = DO_HEAD; printi( 0, "open_inp(): Input file (FMF) opened as %s file.\n", inp_name ); return 0; } static void setup_frame_wh( libspectrum_byte screen_type ) { if( ( scr_t = get_screen_type( screen_type ) ) == HIRES ) { /* screen type => $ R C X */ if( frm_w != 640 ) { frm_w = 640; frm_h = 480; pix_yuv[1] = &pix_rgb[ 640 * 480 ]; pix_yuv[2] = &pix_rgb[ 640 * 480 * 2 ]; } } else { if( frm_w != 320 ) { frm_w = 320; frm_h = 240; pix_yuv[1] = &pix_rgb[ 320 * 240 ]; pix_yuv[2] = &pix_rgb[ 320 * 240 * 2 ]; } } yuv_uvlen = yuv_ylen = frm_w * frm_h; } static int check_fmf_head( void ) { if( memcmp( fhead, "FMF_", 4 ) ) { printe( "Not a Fuse Movie File '%s'\n", inp_name ); return ERR_CORRUPT_INP; } if( fread_buff( fhead, 12, FROM_BUFF ) != 1 || fhead[0] != 'V' || fhead[1] != '1' || /* V1 */ ( fhead[2] != 'e' && fhead[2] != 'E' ) || /* endianness */ ( fhead[3] != 'U' && fhead[3] != 'Z' ) ) /* compressed? */ { printe("This version of Fuse Movie File not supported, sorry...\n"); return ERR_VERSION_INP; } fmf_little_endian = fhead[2] == 'e' ? 1 : 0; fmf_compr = fhead[3] == 'Z' ? 1 : 0; #ifndef USE_ZLIB if( fmf_compr ) { /* error, if no zlib */ printe( "Sorry, no zlib compressed FMF file support in this binary!\n" ); return ERR_NO_ZLIB; } #endif /* USE_ZLIB */ /* Check initial frame parameters */ if( fhead[4] < 1 ) { printe( "Wrong Frame rate '%d', sorry...\n", fhead[4] ); return ERR_CORRUPT_INP; } frm_rte = fhead[4]; /* frame rate (1:#) */ setup_frame_wh( fhead[5] ); frm_mch = get_machine_type( fhead[6] ); /* machine type */ inp_fps = machine_timing[frm_mch] / frm_rte; /* real input fps * 1000 frame / 1000s */ if( out_fps <= 0 ) out_fps = inp_fps; /* later may change */ /* Check initial sound parameters */ if( fhead[8] + ( fhead[9] << 8 ) < 1 ) { printe( "Wrong FMF sound rate '%d', sorry...\n", fhead[8] + ( fhead[9] << 8 ) ); return ERR_CORRUPT_INP; } snd_enc = get_sound_type( fhead[7] ); /* P U A */ snd_rte = fhead[8] + ( fhead[9] << 8 ); snd_chn = get_sound_channels_count( fhead[10] ); snd_fsz = ( snd_enc == PCM ? 2 : 1 ) * snd_chn; if( snd_enc == PCM ) snd_little_endian = fmf_little_endian; if( sound_raw || out_rte == -1 ) out_rte = snd_rte; if( sound_raw ) out_chn = snd_chn; do_now = DO_SLICE; printi( 1, "check_fmf_head(): file: FMF V1 %s endian %scompressed.\n", fmf_little_endian ? "little" : "big", fmf_compr ? "" : "un" ); printi( 1, "check_fmf_head(): video: frame rate = 1:%d frame time: %dus %s machine timing.\n", frm_rte, machine_ftime[frm_mch], get_machine_type_string(frm_mch) ); printi( 1, "check_fmf_head(): audio: sampling rate %dHz %s encoded %s sound.\n", snd_rte, get_sound_type_string( snd_enc ), snd_chn == 2 ? "stereo" : "mono" ); return 0; } static int fmf_read_head( void ) { fread_buff( fhead, 4, FROM_BUFF ); return check_fmf_head(); } static int fmf_read_frame_head( void ) { if( fread_compr( fhead, 3, 1, inp_file ) != 1 ) { printe( "\n\nfmf_read_frame_head(): Corrupt input file (N) @0x%08lx.\n", (unsigned long)ftell( inp_file ) ); return ERR_CORRUPT_INP; } if( fhead[0] < 1 ) { printe( "Wrong Frame rate '%d', sorry...\n", fhead[0] ); return ERR_CORRUPT_INP; } get_screen_type( fhead[1] ); if( fhead[2] < 'A' || fhead[2] > 'E' ) { printe( "Unknown Machine type '%d', sorry...\n", fhead[2] ); return ERR_CORRUPT_INP; } setup_frame_wh( fhead[1] ); if( frm_rte != fhead[0] || frm_mch != get_machine_type( fhead[2] ) ) { /* recalculate timings */ frm_rte = fhead[0]; /* frame rate (1:#) */ frm_mch = get_machine_type( fhead[2] ); /* machine type */ inp_fps = machine_timing[frm_mch] / frm_rte; /* real input fps * 1000 frame / 1000s */ if( out_fps <= 0 ) out_fps = inp_fps; /* later may change */ } do_now = DO_SLICE; frame_no++; time_frm += machine_ftime[frm_mch] * frm_rte; while( time_frm >= 1000000 ) { time_frm -= 1000000; time_sec++; } printi( 2, "fmf_read_frame_head(): rate = 1:%d frame time: %dus %s machine.\n", frm_rte, machine_ftime[frm_mch], get_machine_type_string(frm_mch) ); return 0; } static int fmf_read_chunk_head( void ) { if( fread_compr( fhead, 1, 1, inp_file ) != 1 ) { /* */ printe( "Unexpected end of input file @0x%08lx.\n", (unsigned long)ftell( inp_file ) ); return ERR_ENDOFFILE; } if( fhead[0] != 'N' && fhead[0] != '$' && fhead[0] != 'S' && fhead[0] != 'X' ) { printe( "Unknown FMF chunk type '%d', sorry...\n", fhead[0] ); return ERR_CORRUPT_INP; } printi( 2, "fmf_read_chunk_head(): Chunk: %c - %s\n", fhead[0], fhead[0] == 'N' ? "(N)ew frame" : ( fhead[0] == '$' ? "($)lice": ( fhead[0] == 'S' ? "(S)ound" : ( fhead[0] == 'X' ? "End of recording" : "\???" ) ) ) ); return 0; } static int fmf_read_sound( void ) { int err; int len; static int fmf_snd_head_read = 0; if( !fmf_snd_head_read && fread_compr( fhead, 6, 1, inp_file ) != 1 ) { printe( "\n\nCorrupt input file (S) @0x%08lx.\n", (unsigned long)ftell( inp_file ) ); return ERR_CORRUPT_INP; } fmf_snd_head_read = 1; if( fhead[0] != 'P' && fhead[0] != 'A' ) { printe( "Unknown FMF sound encoding type '%d', sorry...\n", fhead[0] ); return ERR_CORRUPT_INP; } if( fhead[1] + ( fhead[2] << 8 ) < 1 ) { printe( "Wrong FMF sound rate '%d', sorry...\n", fhead[1] + ( fhead[2] << 8 ) ); return ERR_CORRUPT_INP; } if( fhead[3] != 'M' && fhead[3] != 'S' ) { printe( "Unknown FMF sound channels type '%d', sorry...\n", fhead[3] ); return ERR_CORRUPT_INP; } if( snd_len && ( snd_enc != get_sound_type( fhead[0] ) || /* encoding change */ snd_rte != fhead[1] + ( fhead[2] << 8 ) || /* sampling rate change */ snd_chn != get_sound_channels_count( fhead[3] ) ) ) { /* channels change */ printi( 3, "fmf_read_sound(): sound parameters changed flush sound buffer\n" ); do_now = DO_SOUND_FLUSH; return 0; } fmf_snd_head_read = 0; snd_enc = get_sound_type( fhead[0] ); /* P U A */ snd_rte = fhead[1] + ( fhead[2] << 8 ); snd_chn = get_sound_channels_count( fhead[3] ); snd_fsz = ( snd_enc == PCM ? 2 : 1 ) * snd_chn; len = ( fhead[4] + ( fhead[5] << 8 ) + 1 ) * snd_fsz; if( sound_stereo == -1 ) out_chn = snd_chn; if( ( err = alloc_sound_buff( snd_len + snd_frg + len ) ) ) return err; if( fread_compr( (void *)( sound8 + snd_frg + snd_len ), len, 1, inp_file ) != 1 ) { printe( "\n\nCorrupt input file (S) @0x%08lx.\n", (unsigned long)ftell( inp_file ) ); return ERR_CORRUPT_INP; } fmf_sound_no++; if( !cut_cut ) snd_len += len; if( snd_len >= SOUND_BUFF_MAX_SIZE ) { printi( 3, "fmf_read_sound(): flush sound buffer because full\n" ); do_now = DO_SOUND; return 0; } printi( 3, "fmf_read_sound(): %s %dHz %s encoded %s %d samples (%d bytes) sound\n", cut_cut ? "skip" : "store", snd_rte, get_sound_type_string( snd_enc ), snd_chn == 2 ? "stereo" : "mono", len/snd_fsz, len ); return 0; } static int snd_write_sound( void ) { int err; if( snd_len <= 0 ) return 0; if( snd_enc != PCM && sound_pcm && ( err = law_2_pcm() ) ) return err; if( snd_chn == 2 && sound_stereo == 0 && ( err = stereo_2_mono() ) ) return err; if( ( snd_rte != out_rte || snd_frg ) && ( err = resample_sound() ) ) return err; if( snd_chn == 1 && sound_stereo == 1 && ( err = mono_2_stereo() ) ) return err; if( snd_t == TYPE_WAV ) err = snd_write_wav(); else if( snd_t == TYPE_AU ) err = snd_write_au(); else if( snd_t == TYPE_AIFF ) err = snd_write_aiff(); else if( snd_t == TYPE_AVI ) err = snd_write_avi(); snd_len = 0; if( err ) return err; return 0; } static int fmf_gen_sound( void ) { int err; static libspectrum_word len_frag = 0; libspectrum_qword len; if( snd_t == TYPE_NONE ) return 0; /* spectrum frame length * frame rate * freq * framesize 20000 * 9 * 64000 * 4 ~ 5*10^10 so we need 64bit! */ len = (libspectrum_qword)len_frag + (libspectrum_qword)machine_ftime[frm_mch] * frm_rte * snd_rte * snd_fsz; len_frag = len - (len / 1000000) * 1000000; len = len / 1000000; if( ( err = alloc_sound_buff( snd_len + len ) ) ) return err; memset((void *)( sound8 + snd_len ), snd_enc == PCM ? 0 : 0xd5, len); /* only A-Law!!!*/ snd_len += len; printi( 3, "fmf_gen_sound(): store %dHz %s encoded %s %d samples (%d bytes) silence\n", snd_rte, get_sound_type_string( snd_enc ), snd_chn == 2 ? "stereo" : "mono", (int)len/snd_fsz, (int)len ); if( snd_len >= SOUND_BUFF_MAX_SIZE ) { if( ( err = snd_write_sound() ) ) return err; if( do_info ) snd_len = 0; /* anyhow, we have to empty sound buffer */ printi( 3, "fmf_gen_sound(): flush sound buffer because full\n" ); } return 0; } static int close_snd( void ) { snd_write_sound(); /* write pending sound data */ if( snd_t == TYPE_WAV ) snd_finalize_wav(); else if( snd_t == TYPE_AU ) snd_finalize_au(); else if( snd_t == TYPE_AIFF ) snd_finalize_aiff(); if( !snd ) return 0; if( fclose( snd ) ) { fprintf( stderr, "%s: error closing `%s': %s\n", progname, snd_name, strerror( errno ) ); snd = NULL; return ERR_WRITE_SND; } snd = NULL; return 0; } static int fmf_read_slice_blokk( libspectrum_byte *scrl, int w, int h ) { int last = -1, d = -1, width = w, len = 0, i; libspectrum_byte *scrp; for( ; h > 0; h--, scrl += SCR_PITCH ) { /* every line */ scrp = scrl; w = width; /* restore width */ while( w > 0 ) { if( len == 0 ) { if( ( d = fgetc_compr( inp_file ) ) == -1 ) { printe( "\n\nCorrupt input file ($) @0x%08lx.\n", (unsigned long)ftell( inp_file ) ); return ERR_CORRUPT_INP; /* read a byte */ } if( d == last ) { /* compressed chunk... */ if( ( len = fgetc_compr( inp_file ) ) == -1 ) { printe( "\n\nCorrupt input file ($) @0x%08lx.\n", (unsigned long)ftell( inp_file ) ); return ERR_CORRUPT_INP; /* read a byte */ } len++; last = -1; /* 0 - 255 */ } else { len = 1, last = d; } } if( len > w ) i = w; else i = len; len -= i; w -= i; for(; i > 0; i-- ) *scrp++ = d; /* save data */ } } return 0; } static int fmf_read_screen( void ) { int err; if( fread_compr( fhead, 6, 1, inp_file ) != 1 ) { printe( "\n\nCorrupt input file ($) @0x%08lx.\n", (unsigned long)ftell( inp_file ) ); return ERR_CORRUPT_INP; } if( fhead[0] > 39 ) { printe( "Wrong FMF slice X position '%d', sorry...\n", fhead[0] ); return ERR_CORRUPT_INP; } if( fhead[1] + ( fhead[2] << 8 ) > 239 ) { printe( "Wrong FMF slice Y position '%d', sorry...\n", fhead[1] + ( fhead[2] << 8 ) ); return ERR_CORRUPT_INP; } if( fhead[3] - 1 > 39 ) { printe( "Wrong FMF slice Width '%d', sorry...\n", fhead[3] ); return ERR_CORRUPT_INP; } if( fhead[4] + ( fhead[5] << 8 ) - 1 > 239 ) { printe( "Wrong FMF slice Height '%d', sorry...\n", fhead[4] + ( fhead[5] << 8 ) ); return ERR_CORRUPT_INP; } frm_slice_x = fhead[0]; frm_slice_y = fhead[1] + ( fhead[2] << 8 ); frm_slice_w = fhead[3]; frm_slice_h = fhead[4] + ( fhead[5] << 8 ); /* read bitmap1 */ /* fprintf( stderr, "$0 0x%08x: %d,%d %dx%d\n", (unsigned int) ftell( scr ) - 7, fmf_x, fmf_y ,fmf_w, fmf_h ); */ if( ( err = fmf_read_slice_blokk( zxscr + frm_slice_y * SCR_PITCH + frm_slice_x, frm_slice_w, frm_slice_h ) ) ) return err; /* we store it with cont. */ /* read bitmap2 if HighResolution Timex */ if( scr_t == HIRES && ( err = fmf_read_slice_blokk( zxscr + 9600 + frm_slice_y * SCR_PITCH + frm_slice_x, frm_slice_w, frm_slice_h ) ) ) return err; /* we store it with cont. */ /*read attrib */ /* fprintf( stderr, "Attr 0x%08x: %d,%d %dx%d\n", (unsigned int) ftell( scr ) - 7, fmf_x, fmf_y ,fmf_w, fmf_h ); */ if( ( err = fmf_read_slice_blokk( attrs + frm_slice_y * SCR_PITCH + frm_slice_x, frm_slice_w, frm_slice_h ) ) ) return err; /* fprintf(stderr, "next slice@0x%08x\n", (unsigned int)ftell(scr)); */ fmf_slice_no++; printi( 3, "fmf_read_screen(): x=%d, y=%d, w=%d, h=%d\n", frm_slice_x, frm_slice_y, frm_slice_w, frm_slice_h ); return 0; } static int fmf_read_slice( void ) { int err = 0; if( ( err = fmf_read_chunk_head() ) ) return err; if( fhead[0] == 'N' ) { /* end of frame, start new frame! */ do_now = DO_FRAME; /* we have to handle cut here */ if( cut_cmd != TYPE_NONE ) { if( cut_cmd == TYPE_CUT && ( cut_t_t == TYPE_FRAME ? frame_no > cut__to : time_sec > cut__to ) ) inp_get_next_cut(); if( ( cut_f_t == TYPE_FRAME ? frame_no >= cut_frm : time_sec >= cut_frm ) && ( cut_cmd == TYPE_CUTFROM || ( cut_t_t == TYPE_FRAME ? frame_no <= cut__to : time_sec <= cut__to ) ) ) { if( cut_cmd == TYPE_CUTFROM ) fmfconv_stop = 1; drop_no++; cut_cut = 1; } } if( sound_exists == 0 && !cut_cut ) err = fmf_gen_sound(); /* generate silence */ sound_exists = 0; } else if( fhead[0] == 'X' ) { do_now = DO_LAST_FRAME; } else if( fhead[0] == 'S' ) { sound_exists = 1; /* found a sound chunk */ return fmf_read_sound(); } else { /* read screen */ return fmf_read_screen(); } return err; } /* store RGB/YUV/Paletted color/grayscale pixel*/ static void pix_pix( int *idx, int xx, int i ) { if( out_t >= TYPE_YUV ) { pix_yuv[0][*idx] = yuv_pal[ xx * 3 + 0 ]; if( !greyscale ) { pix_yuv[1][*idx] = yuv_pal[ xx * 3 + 1 ]; pix_yuv[2][*idx] = yuv_pal[ xx * 3 + 2 ]; } (*idx)++; } else if( out_t >= TYPE_PPM ) { if( png_palette > 0 ) { if( i & 0x01 ) { pix_rgb[*idx] &= 0xf0; pix_rgb[*idx] |= xx; (*idx)++; } else { pix_rgb[*idx] &= 0x0f; pix_rgb[*idx] |= xx << 4; } } else { if( greyscale ) { pix_rgb[*idx] = yuv_pal[ xx * 3 + 0 ]; (*idx)++; } else { pix_rgb[*idx] = rgb_pal[ xx * 3 + 0 ]; (*idx)++; pix_rgb[*idx] = rgb_pal[ xx * 3 + 1 ]; (*idx)++; pix_rgb[*idx] = rgb_pal[ xx * 3 + 2 ]; (*idx)++; } } } } static int output_uses_rendered_pixels( void ) { return out_t >= TYPE_PPM; } static void out_2_pix( void ) { libspectrum_byte *bitmap, *attr; int i, w, idx; int x = frm_slice_x, y = frm_slice_y, h = frm_slice_h; int inv = ( frame_no * frm_rte % 32 ) > 15 ? 1 : 0; w = frm_slice_w; for( h = frm_slice_h; h > 0; h--, y++, w = frm_slice_w ) { if( scr_t != HIRES ) idx = y * OUT_PITCH + x * 8 ; /* 8pixel/data */ else idx = y * OUT_PITCH * 2 + x * 16 ; /* 16 pixel/data*/ if( png_palette > 0 ) idx /= 2; else if( out_t < TYPE_YUV && !greyscale ) idx *= 3; bitmap = &zxscr[SCR_PITCH * y + x]; attr = &attrs[SCR_PITCH * y + x]; for( ; w > 0; w--, bitmap++, attr++ ) { int px, fx, ix = *attr; int bits = scr_t == HIRES ? ( *bitmap << 8 ) + *(bitmap + 9600) : *bitmap; fx = ( ix & 0x80 ) * inv; px = ( ( ix & 0x38 ) >> 3 ) + ( ( ix & 0x40 ) ? 8 : 0 ); ix = ( ix & 0x07 ) + ( ( ix & 0x40 ) ? 8 : 0 ); for( i = scr_t == HIRES ? 16 : 8; i > 0; i-- ) { pix_pix( &idx, ( bits ^ fx ) & 128 ? ix : px, i ); bits <<= 1; } } } } /* fmfconv derives FLASH from the FMF frame number rather than receiving the producer's rendered FLASH phase. When that derived phase changes, every flashing cell changes visually even if no new FMF screen slice covers it. Refresh the complete cached screen so output pixels cannot retain the previous phase. */ static void out_refresh_flash_phase( void ) { static int previous_phase = -1; int phase = ( frame_no * frm_rte % 32 ) > 15; int saved_x, saved_y, saved_w, saved_h; if( phase == previous_phase ) return; previous_phase = phase; saved_x = frm_slice_x; saved_y = frm_slice_y; saved_w = frm_slice_w; saved_h = frm_slice_h; frm_slice_x = 0; frm_slice_y = 0; frm_slice_w = SCR_PITCH; frm_slice_h = 240; out_2_pix(); frm_slice_x = saved_x; frm_slice_y = saved_y; frm_slice_w = saved_w; frm_slice_h = saved_h; } static int out_write_frame( void ) { static int fmf_fps = 0; int err; int add_frame = 0; int n = -fmf_fps / inp_fps; if( fmf_fps > 0 ) { drop_no++; printi( 2, "out_write_frame(): drop this frame.\n" ); } else if( cut_cut ) { drop_no++; printi( 2, "out_write_frame(): cut this frame.\n" ); return 0; } while( fmf_fps <= 0 ) { if( n > 1 ) { /* we have to add sound in more part */ } else { snd_write_sound(); } if( add_frame ) { printi( 2, "out_write_frame(): add this frame again.\n" ); dupl_no++; } else { printi( 2, "out_write_frame(): add frame.\n" ); add_frame = 1; } if( out_t == TYPE_YUV ) { if( ( err = out_write_yuv() ) ) return err; } else if( out_t == TYPE_SCR ) { if( ( err = out_write_scr() ) ) return err; } else if( out_t == TYPE_PPM ) { if( ( err = out_write_ppm() ) ) return err; #ifdef USE_LIBPNG } else if( out_t == TYPE_PNG ) { if( ( err = out_write_png() ) ) return err; #endif } else if( out_t == TYPE_AVI ) { if( ( err = out_write_avi() ) ) return err; #ifdef USE_LIBJPEG } else if( out_t == TYPE_JPEG ) { if( ( err = out_write_jpg() ) ) return err; } else if( out_t == TYPE_MJPEG ) { if( ( err = out_write_mjpeg() ) ) return err; #endif } fmf_fps += inp_fps; output_no++; if( ( out_t >= TYPE_SCR && out_t <= TYPE_JPEG ) ) { close_out(); if( ( err = open_out() ) ) return err; } } fmf_fps -= out_fps; return 0; } int close_out( void ) { if( !out ) return 0; #ifdef USE_LIBJPEG if( out_t == TYPE_MJPEG && out_header_ok ) out_finalize_mjpeg(); #endif if( out_t == TYPE_AVI && out_header_ok ) out_finalize_avi(); if( fclose( out ) ) { fprintf( stderr, "%s: error closing `%s': %s\n", progname, out_name, strerror( errno ) ); out = NULL; return ERR_WRITE_OUT; } out = NULL; return 0; } static void prepare_next_file( void ) /* multiple input file */ { if( input_no > input_last_no ) do_now = DO_EOP; /* no more file */ else input_no++; } static void print_version( void ) { printf( PROGRAM_NAME " (" PACKAGE " " PACKAGE_VERSION ") " FMFCONV_VER_STRING "\n" "Copyright (c) 2004-2005 Gergely Szasz\n" "License GPLv2+: GNU GPL version 2 or later " "\n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" ); #if defined USE_LIBPNG || defined USE_LIBPNG printf( "Compiled with:\n" ); #else printf( "Compiled without any external library support.\n" ); #endif #ifdef USE_LIBJPEG print_jpeg_version(); #endif #ifdef USE_LIBPNG print_png_version(); #endif } static void print_help( void ) { printf ("\n" "Usage: %s [OPTION]... [infile [outfile [soundfile]]]\n" "Converts Fuse movie files to different multimedia files.\n" "\n" "Options:\n" "\n" " -i --input Input file.\n" " -o --output Output file.\n" " -s --sound Output sound file.\n" " -y --overwrite Force overwrite output file(s).\n" " --sound-only Process only the sound from an `fmf' file.\n" " --mono Convert sound to mono (by default sound\n" " is converted to stereo).\n" " --raw-sound Do not convert sound to 16 bit signed PCM and\n" " STEREO or MONO.\n" " This is an advanced option. If stereo/mono or\n" " audio encoding change through `fmf' file, your\n" " sound will be crappy.\n" " -E --srate Resample audio to sampling rate where\n" " is `cd' for 44100 or `dat' for 48000 or\n" " a number (`cd' and `dat' set `stereo' as well)\n" " -w --wav Save sound to Microsoft audio (wav) file.\n" " -u --au Save sound to Sun Audio (au) file.\n" " -m --aiff Save sound to Apple Computer audio (aiff/aiff-c)\n" " file.\n" " --aifc Force AIFF-C output if sound format is AIFF\n" " -Y --yuv Save video as yuv4mpeg2.\n" " --yuv-format Set yuv4mpeg2 file frame format to `frm',\n" " where `frm' is one of `444', `422',\n" " `420j', `420m', `420' or `410'.\n" " -S --scr Save video as SCR screenshots.\n" " -P --ppm Save video as PPM screenshots.\n" #ifdef USE_LIBPNG " -G --png Save video as PNG screenshots.\n" " --png-compress Set compression level, where between 0\n" " and 9, or `none', `fast', `best'.\n" " --progressive Save progressive (interlaced) PNG file.\n" #endif #ifdef USE_LIBJPEG " -J --jpg Save video as JPEG screenshots.\n" " -Q --jpg-quality Set jpeg quality, where between 0 and 100.\n" " --jpg-smooth Set jpeg smoothing factor, where \n" " between 0 and 100.\n" " --jpg-optimize libjpeg optimize Huffman tables.\n" " --jpg-float libjpeg use float DCT algorithm.\n" " --jpg-fast libjpeg use fast DCT algorithm.\n" " --progressive Save progressive (interlaced) JPEG file.\n" " -M --mjpeg Save video as raw MJPEG file (abbreviated JPEG\n" " stream).\n" " --avi Save video as internal AVI encoder format.\n" " Encode video as M-JPEG and audio as S16_LE PCM\n" " If output is not a file (stdout or redirected)\n" " then fmfconv encode video as uncompressed\n" " BGR24 DIB frames.\n" " --avi-uncompr Force uncompressed AVI frames.\n" " --avi-mjpeg Force M-JPEG AVI frames.\n" #else " --avi Save video as internal AVI encoder format.\n" " Encode video as uncompressed BGR24 DIB frames\n" " and audio as S16_LE PCM.\n" #endif " --greyscale Save greyscale image/video.\n" " -f --frate Set output frame rate. `timing' is `raw', `pal',\n" " `ntsc', `movie' or a number with a maximum\n" " of 3 digits after the decimal point, or a #/#\n" " (e.g.: -f 29.97 or -f 30000/1001).\n" " For video output formats (AVI/MJPEG/YUV4MPEG2)\n" " fmfconv set framerate to 25fps (PAL timing).\n" " If you want to keep the original framerate use\n" " --frate raw.\n" " -g --progress
Show progress, where is one of `%%', `bar'\n" " `frame' or `time'. frame and time are similar\n" " to bar and show movie seconds or frame number\n" " as well.\n" " -C --out-cut Leave out the comma delimited `cut' ranges\n" " e.g.: 100-200,300,500,1:11-2:22 cut the frames\n" " 100-200, 300, 500 and frames from 1min 11sec\n" " to 2min 22sec (in the given timing see:\n" " -f/--frate).\n" " --info Scan input file(s) and print information.\n" " -v --verbose Increase the verbosity level by one.\n" " -q --quiet Decrease the verbosity level by one.\n" " -V --version Print the version number and exit.\n" " -h --help Print this help.\n" "\n" "Report %s bugs to <%s>\n" "%s home page: <%s>\n" "For complete documentation, see the manual page of %s.\n", progname, PROGRAM_NAME, PACKAGE_BUGREPORT, PACKAGE_NAME, PACKAGE_URL, PROGRAM_NAME ); } static void print_progress( int force ) { static long int fpos = 0; long int npos; int perc; static int last_perc = -1; const char *bar = "##############################################################################"; const char *spc = " "; if( !inp_ftell ) return; npos = ftell( inp_file ); if( npos <= fpos ) return; perc = (libspectrum_signed_qword)npos * 1009 / inp_ftell / 10; if( !force && last_perc == perc ) return; if( perc > 100 ) perc = 100; if( prg_t == TYPE_PERC ) fprintf( stderr, "Percent: %4d%%\r", perc ); else if( prg_t == TYPE_BAR ) fprintf( stderr, "[%s%s]\r", bar + 78 - 78 * perc / 100, spc + 78 * perc / 100 ); else if( prg_t == TYPE_FRAME ) fprintf( stderr, "[%s%s]%8"PRIu64"\r", bar + 78 - 70 * perc / 100, spc + 8 + 70 * perc / 100, frame_no ); else if( prg_t == TYPE_TIME ) fprintf( stderr, "[%s%s]%8"PRIu64"\r", bar + 78 - 70 * perc / 100, spc + 8 + 70 * perc / 100, time_sec ); last_perc = perc; } #define ARG_YUV_FORMAT 0x101 #define ARG_AIFC 0x102 #define ARG_SOUND_ONLY 0x103 #define ARG_JPG_SMOOTH 0x105 #define ARG_JPG_OPT 0x106 #define ARG_JPG_FLOAT 0x107 #define ARG_JPG_FAST 0x108 #define ARG_PNG_COMPRESS 0x109 #define ARG_PNG_RGB 0x110 #define ARG_AVI 0x111 #define ARG_AVI_DIB 0x112 #define ARG_AVI_MJPEG 0x113 #define ARG_PROGRESSIVE 0x114 #define ARG_GREYSCALE 0x115 static int parse_args( int argc, char *argv[] ) { struct option long_options[] = { {"input", 1, NULL, 'i'}, {"output", 1, NULL, 'o'}, {"sound", 1, NULL, 's'}, {"overwrite", 0, NULL, 'y'}, {"sound-only", 0, NULL, ARG_SOUND_ONLY}, {"mono", 0, &sound_stereo, 0}, /* set mono */ {"raw-sound",0, &sound_raw, 1}, /* do not convert fmf sound to PCM_S16LE */ /* {"no-sound", 0, &video_only, 1}, */ {"srate", 1, NULL, 'E'}, /* audio new samplerate cd/dat set 'stereo' also */ {"wav", 0, NULL, 'w'}, /* save .wav sound */ {"au", 0, NULL, 'u'}, /* save .au sound */ {"aiff", 0, NULL, 'm'}, /* save .aiff sound */ {"aifc", 0, NULL, ARG_AIFC}, /* force aifc */ /* {"simple-height", 0, &simple_height, 1}, {"no-aspect", 0, &simple_height, -1}, */ {"scr", 0, NULL, 'S'}, /* extract as SCR */ {"ppm", 0, NULL, 'P'}, /* extract as PPM */ {"yuv", 0, NULL, 'Y'}, /* YUV output */ {"yuv-format", 1, NULL, ARG_YUV_FORMAT}, {"frate", 1, NULL, 'f'}, /* video frame rate */ {"progress",1,NULL, 'g'}, /* progress 'bar' */ {"cut", 1, NULL, 'C'}, /* TODO cut */ #ifdef USE_LIBJPEG {"jpg", 0, NULL, 'J'}, /* jpeg */ {"jpg-quality", 1, NULL, 'Q'}, /* jpeg quality */ {"jpg-smooth", 1, NULL, ARG_JPG_SMOOTH}, /* jpeg smoothing */ {"jpg-optimize", 0, NULL, ARG_JPG_OPT}, /* jpeg optimize */ {"jpg-float", 0, NULL, ARG_JPG_FLOAT}, /* jpeg float DTC */ {"jpg-fast", 0, NULL, ARG_JPG_FAST}, /* jpeg fast DCT */ {"mjpeg", 0, NULL, 'M'}, /* M-JPEG */ #endif {"avi", 0, NULL, ARG_AVI}, /* select internal AVI output */ #ifdef USE_LIBJPEG {"avi-uncompr", 0, NULL, ARG_AVI_DIB}, /* force uncompressed AVI output */ {"avi-mjpeg", 0, NULL, ARG_AVI_MJPEG}, /* force compressed AVI output */ #endif #ifdef USE_LIBPNG {"png", 0, NULL, 'G'}, /* PNG */ {"png-compress", 1, NULL, ARG_PNG_COMPRESS}, /* PNG compression */ {"png-rgb", 0, NULL, ARG_PNG_RGB}, /* PNG RGB24 */ #endif #if defined USE_LIBJPEG || USE_LIBPNG {"progressive", 0, NULL, ARG_PROGRESSIVE}, /* jpeg/png progressive */ #endif {"greyscale", 0, NULL, ARG_GREYSCALE}, /* convert to grescale */ {"info", 0, &do_info, 1}, {"help", 0, NULL, 'h'}, {"version", 0, NULL, 'V'}, {"verbose", 0, NULL, 'v'}, {"quiet", 0, NULL, 'q'}, {0, 0, 0, 0} /* End marker: DO NOT REMOVE */ }; /* atexit( &cleanup ); */ while( 1 ) { int c; char t; int i; c = getopt_long (argc, argv, "i:o:s:f:g:C:wumSPYyE:" #ifdef USE_LIBJPEG "JQ:M" #endif #ifdef USE_LIBPNG "G" #endif "hVvq", long_options, NULL); if( c == -1 ) break; /* End of option list */ switch( c ) { case 0: break; /* Used for long option returns */ case 'i': inp_name = optarg; /* strdup( optarg ); ?? */ break; case 'o': out_name = optarg; /* strdup( optarg ); ?? */ break; case 's': snd_name = optarg; /* strdup( optarg ); ?? */ break; case 'y': overwr_out = 1; /* force overwrite existing output files */ break; case 'w': snd_t = TYPE_WAV; /* audio container WAV */ break; case 'u': snd_t = TYPE_AU; /* audio container AU */ break; case 'm': snd_t = TYPE_AIFF; /* audio container AIFF */ break; case ARG_AIFC: force_aifc = 1; break; case ARG_SOUND_ONLY: sound_only = 1; out_t = TYPE_NONE; break; case 'E': if( !strcmp( optarg, "cd" ) ) out_rte = 44100, sound_stereo = 1; else if( !strcmp( optarg, "dat" ) ) out_rte = 48000, sound_stereo = 1; else out_rte = atoi( optarg ); if( out_rte < 1000 ) { printe( "Wrong value for '-E/--srate' ...\n"); return ERR_BAD_PARAM; } break; case 'S': /* SCR output */ out_t = TYPE_SCR; break; case 'P': /* PPM output */ out_t = TYPE_PPM; break; case ARG_AVI: /* internal AVI encoder */ out_t = TYPE_AVI; snd_t = TYPE_AVI; break; #ifdef USE_LIBJPEG case 'J': /* JPEG output */ out_t = TYPE_JPEG; break; case 'Q': /* JPEG output */ jpg_quality = atoi( optarg ); break; case ARG_JPG_SMOOTH: /* JPEG smooth */ jpg_smooth = atoi( optarg ); break; case ARG_JPG_OPT: /* JPEG optimize */ jpg_optimize = 1; break; case ARG_JPG_FLOAT: /* JPEG float */ jpg_dctfloat = 1; break; case ARG_JPG_FAST: /* JPEG fast */ jpg_idctfast = 1; break; case 'M': /* M-JPEG output */ out_t = TYPE_MJPEG; break; case ARG_AVI_DIB: /* uncompressed AVI */ out_t = TYPE_AVI; snd_t = TYPE_AVI; avi_subtype = TYPE_AVI_DIB; break; case ARG_AVI_MJPEG: /* compressed AVI */ out_t = TYPE_AVI; snd_t = TYPE_AVI; avi_subtype = TYPE_AVI; break; #endif #ifdef USE_LIBPNG case 'G': /* PNG output */ out_t = TYPE_PNG; break; case ARG_PNG_COMPRESS: /* PNG compression */ if( !strcmp( optarg, "none" ) ) png_compress = Z_NO_COMPRESSION; else if( !strcmp( optarg, "fast" ) ) png_compress = Z_BEST_SPEED; else if( !strcmp( optarg, "default" ) ) png_compress = Z_DEFAULT_COMPRESSION; else if( !strcmp( optarg, "best" ) ) png_compress = Z_BEST_COMPRESSION; else png_compress = atoi( optarg ); break; case ARG_PNG_RGB: /* PNG palette */ png_palette = 0; break; #endif #if defined USE_LIBJPEG || defined USE_LIBPNG case ARG_PROGRESSIVE: /* JPEG/PNG progressive */ progressive = 1; break; case ARG_GREYSCALE: /* Greyscale */ greyscale = 1; break; #endif case 'Y': /* YUV output */ out_t = TYPE_YUV; break; case ARG_YUV_FORMAT: /* YUV FORMAT */ if( !strcmp( optarg, "444" ) ) yuv_t = TYPE_444; else if( !strcmp( optarg, "422" ) ) yuv_t = TYPE_422; else if( !strcmp( optarg, "420j" ) || !strcmp( optarg, "420jpeg" ) || !strcmp( optarg, "420mpeg1" ) ) yuv_t = TYPE_420J; else if( !strcmp( optarg, "420m" ) || !strcmp( optarg, "420mpeg2" ) ) yuv_t = TYPE_420M; else if( !strcmp( optarg, "420" ) ) yuv_t = TYPE_420; /* else if( !strcmp( optarg, "410" ) ) yuv_t = TYPE_410; */ else { printe( "Bad value for --yuv-format ...\n"); return ERR_BAD_PARAM; } break; case 'f': /* output frame rate */ if( !strcmp( optarg, "raw" ) ) out_fps = -1; else if( !strcmp( optarg, "pal" ) ) out_fps = 25000; /* 25.000 1/s */ else if( !strcmp( optarg, "ntsc" ) ) out_fps = 29970; /* 29.970 1/s */ else if( !strcmp( optarg, "movie" ) ) out_fps = 24000; /* 24.000 1/s */ else if( sscanf( optarg, "%d.%1d%c", &out_fps, &i, &t ) == 2 ) out_fps = out_fps * 1000 + i * 100; else if( sscanf( optarg, "%d.%2d%c", &out_fps, &i, &t ) == 2 ) out_fps = out_fps * 1000 + i * 10; else if( sscanf( optarg, "%d.%3d%c", &out_fps, &i, &t ) == 2 ) out_fps = out_fps * 1000 + i; else if( sscanf( optarg, "%d/%d%c", &out_fps, &i, &t ) == 2 ) out_fps = out_fps * 1000 / i; else if( sscanf( optarg, "%d%c", &out_fps, &t ) == 1 ) out_fps *= 1000; else { printe( "Unknown value for '-f/--frate' ...\n" ); return ERR_BAD_PARAM; } if( out_fps != -1 && out_fps < 1 ) { printe( "Bad value for '-f/--frate' ...\n"); return ERR_BAD_PARAM; } break; case 'C': out_cut = optarg; inp_get_next_cut(); break; case 'h': print_help(); help_exit = 1; break; case 'V': print_version(); help_exit = 1; break; case 'v': if( verbose < VERBOSE_MAX ) verbose++; break; case 'q': if( verbose > VERBOSE_MIN ) verbose--; break; case 'g': /* progress 'bar' */ if( !strcmp( optarg, "%" ) ) prg_t = TYPE_PERC; else if( !strcmp( optarg, "bar" ) ) prg_t = TYPE_BAR; else if( !strcmp( optarg, "frame" ) ) prg_t = TYPE_FRAME; else if( !strcmp( optarg, "time" ) ) prg_t = TYPE_TIME; break; case '?': /* getopt prints an error message to stderr */ return ERR_BAD_PARAM; default: printe ("%s: getopt_long returned `%c'\n", progname, (char) c); return ERR_BAD_PARAM; } } if( optind < argc ) inp_name = argv[optind++]; if( !sound_only && optind < argc ) /* if sound only, we use second nonopt arg as sound filename*/ out_name = argv[optind++]; if( optind < argc ) snd_name = argv[optind++]; if( optind < argc ) { printe ("Too many filenames...\n"); return ERR_BAD_PARAM; } if( !help_exit && !inp_name ) { int fd = fileno( stdin ); if( isatty( fd ) ) { printe( "%s: no input file specified\n", progname ); return ERR_BAD_PARAM; } #ifdef WIN32 else { setmode( fd, O_BINARY ); } #endif /* #ifdef WIN32 */ } return 0; } #ifdef HAVE_SIGNAL static void fmfconv_exit( int signal ) { fmfconv_stop = 1; } #endif int main( int argc, char *argv[] ) { int err = 0, eop = 0; progname = argv[0]; if( ( err = parse_args( argc, argv ) ) ) { fprintf( stderr, "Try `%s --help' for more information.\n", progname ); return err; } if( help_exit ) return 0; if( do_info ) { snd_t = TYPE_NONE; out_t = TYPE_NONE; if( verbose < 1 ) verbose = 1; } if( sound_only ) { out_t = TYPE_NONE; } if( !sound_only && ( err = open_out() ) ) return err; if( ( err = open_snd() ) ) return err; if( snd_t == TYPE_UNSET ) { snd_t = TYPE_NONE; } if( sound_raw ) { sound_pcm = 0; sound_stereo = -1; } if( sound_stereo == 1 ) out_chn = 2; else if( sound_stereo == 0 ) out_chn = 1; #ifdef USE_ZLIB fmf_compr_init(); #endif /* USE_ZLIB */ #ifdef HAVE_SIGNAL signal( SIGINT, fmfconv_exit ); #endif while( !eop ) { if( fmfconv_stop ) do_now = DO_EOP; switch ( do_now ) { case DO_FILE: prepare_next_file(); /* If we process multiple files, open (next) input file */ if( do_now != DO_EOP && ( err = open_inp() ) ) eop = 1; break; case DO_HEAD: /* read (next) file header */ if( ( err = fmf_read_head() ) ) eop = 1; break; case DO_FRAME_HEAD: /* After finishing a frame, read next frame settings */ if( ( err = fmf_read_frame_head() ) ) eop = 1; break; case DO_SLICE: /* read next fmf slice or 'N' or 'S' or 'X' */ if( ( err = fmf_read_slice() ) ) eop = 1; if( out_t != TYPE_NONE ) { /* convert slice to RGB or YUV if needed */ if( output_uses_rendered_pixels() ) out_2_pix(); } break; case DO_SOUND: case DO_SOUND_FLUSH: if( snd_t != TYPE_NONE && ( err = snd_write_sound() ) ) eop = 1; if( do_info ) snd_len = 0; /* anyhow, we have to empty sound buffer */ if( do_now == DO_SOUND_FLUSH ) fmf_read_sound(); do_now = DO_SLICE; break; case DO_FRAME: if( out_t != TYPE_NONE ) { if( output_uses_rendered_pixels() ) out_refresh_flash_phase(); if( ( err = out_write_frame() ) ) eop = 1; } case DO_LAST_FRAME: if( inp_t == TYPE_FMF ) { if( do_now == DO_LAST_FRAME ) { fread_buff( fhead, 1, INTO_BUFF ); /* check concatenation */ if( feof_compr( inp_file ) ) do_now = DO_FILE; else do_now = DO_HEAD; } else { do_now = DO_FRAME_HEAD; } } else { do_now = DO_FILE; } break; case DO_EOP: eop = 1; break; default: printe( "Unknown action type %d\n", do_now ); eop = 1; break; } if( prg_t != TYPE_NONE && frame_no % 11 == 0 ) print_progress( 0 ); } if( prg_t != TYPE_NONE ) { print_progress( 1 ); /* update progress */ fprintf( stderr, "\n" ); } #ifdef USE_ZLIB fmf_compr_end(); #endif /* USE_ZLIB */ if( ( out_t >= TYPE_SCR && out_t <= TYPE_JPEG ) && out_name ) unlink( out_name ); /* close snd file */ err = close_snd(); if( err ) { close_out(); return err; } /* close out file */ err = close_out(); if( err ) return err; /* print global stats */ printi( 0, "main(): read %"PRIu64" frames (%"PRIu64" sec), %"PRIu64" fmf slices and %"PRIu64" fmf sound chunks\n", frame_no, time_sec, fmf_slice_no, fmf_sound_no ); if( !do_info ) printi( 0, "main(): wrote %"PRIu64" frames, dropped %"PRIu64" frames and inserted %"PRIu64" frames\n", output_no, drop_no, dupl_no ); return 0; } fuse-utils-1.5.1/tapeconv.c0000664000175000017500000003011115267623700014623 0ustar00fredmfredm/* tapeconv.c: Convert between ZX Spectrum tape image formats Copyright (c) 2002-2008 Philip Kendall, Fredrick Meunier Copyright (c) 2015 Sergio Baldovi 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. Author contact information: E-mail: philip-fuse@shadowmagic.org.uk */ #include "config.h" #include #include #include #include #include #include "libspectrum.h" #include "utils.h" #define PROGRAM_NAME "tapeconv" #define DESCRIPTION_BUFFER_LEN 0x10 static void show_help( void ); static void show_version( void ); static int get_type_from_string( libspectrum_id_t *type, const char *string ); static int read_tape( char *filename, libspectrum_tape **tape ); static int update_archive_file( char *archive_file, libspectrum_tape *tape ); static int append_scr_file( char *scr_file, libspectrum_tape *tape ); static int append_inlay_file( char *inlay_file, libspectrum_tape *tape ); static int write_tape( char *filename, libspectrum_tape *tape ); static int beautify_tzx_file( libspectrum_tape *tape ); static int remove_block_type( libspectrum_tape *tape, libspectrum_tape_type id ); static int is_filetype( const char* new_filename, const char* type ); char *progname; char *archive_file = NULL; int beautify = 0; char *scr_file = NULL; char *inlay_file = NULL; int main( int argc, char **argv ) { int c, error = 0; libspectrum_tape *tzx; progname = argv[0]; struct option long_options[] = { { "help", 0, NULL, 'h' }, { "version", 0, NULL, 'V' }, { 0, 0, 0, 0 } }; while( ( c = getopt_long( argc, argv, "a:s:i:bhV", long_options, NULL ) ) != -1 ) { switch( c ) { case 'a': archive_file = optarg ; break; case 'b': beautify = 1; break; case 's': scr_file = optarg ; break; case 'i': inlay_file = optarg ; break; case 'h': show_help(); return 0; case 'V': show_version(); return 0; case '?': /* getopt prints an error message to stderr */ error = 1; break; default: error = 1; fprintf( stderr, "%s: unknown option `%c'\n", progname, (char) c ); break; } } argc -= optind; argv += optind; if( error ) { fprintf( stderr, "Try `%s --help' for more information.\n", progname ); return error; } if( argc < 2 ) { fprintf( stderr, "%s: usage: %s [-s ] [-a ] " "[-b] [-i ] \n", progname, progname ); fprintf( stderr, "Try `%s --help' for more information.\n", progname ); return 1; } error = init_libspectrum(); if( error ) return error; if( read_tape( argv[0], &tzx ) ) return 1; if( archive_file && update_archive_file( archive_file, tzx ) ) { libspectrum_tape_free( tzx ); return 1; } if( scr_file && append_scr_file( scr_file, tzx ) ) { libspectrum_tape_free( tzx ); return 1; } if( inlay_file && append_inlay_file( inlay_file, tzx ) ) { libspectrum_tape_free( tzx ); return 1; } if( beautify && beautify_tzx_file( tzx ) ) { libspectrum_tape_free( tzx ); return 1; } if( write_tape( argv[1], tzx ) ) { libspectrum_tape_free( tzx ); return 1; } libspectrum_tape_free( tzx ); return 0; } static void show_version( void ) { printf( PROGRAM_NAME " (" PACKAGE ") " PACKAGE_VERSION "\n" "Copyright (c) 2002-2008 Philip Kendall, Fredrick Meunier\n" "License GPLv2+: GNU GPL version 2 or later " "\n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" ); } static void show_help( void ) { printf( "Usage: %s [OPTION]... \n" "Converts between ZX Spectrum tape images, including TAP, TZX, PZX and CSW.\n" "Output format is selected by filename extension (default: TZX).\n" "PZX output omits message, hardware and Custom Info metadata.\n" "\n" "Options:\n" " -a \n" " Scan the TZX supplied for a Archive Info block and dump\n" " to the output tape.\n" " -b Strip output TZX of any concatenation blocks that get created\n" " when appending TZX files.\n" " -s \n" " Attach a .scr file to the TZX as a Custom Info block marked\n" " as a loading screen. Omitted from PZX output with a warning.\n" " -i \n" " Attach an image file to the TZX as a Custom Info block marked\n" " as a cassette inlay. Omitted from PZX output with a warning.\n" " -h, --help Display this help and exit.\n" " -V, --version Output version information and exit.\n" "\n" "Report %s bugs to <%s>\n" "%s home page: <%s>\n" "For complete documentation, see the manual page of %s.\n", progname, PROGRAM_NAME, PACKAGE_BUGREPORT, PACKAGE_NAME, PACKAGE_URL, PROGRAM_NAME ); } static int get_type_from_string( libspectrum_id_t *type, const char *string ) { libspectrum_class_t class; int error; /* Work out what sort of file we want from the filename; default to .tzx if we couldn't guess */ error = libspectrum_identify_file_with_class( type, &class, string, NULL, 0 ); if( error ) return error; if( class != LIBSPECTRUM_CLASS_TAPE || *type == LIBSPECTRUM_ID_UNKNOWN ) *type = LIBSPECTRUM_ID_TAPE_TZX; return 0; } static int read_tape( char *filename, libspectrum_tape **tape ) { libspectrum_file file; if( read_file( filename, &file ) ) return 1; *tape = libspectrum_tape_alloc(); if( libspectrum_tape_read( *tape, file.buffer, file.length, file.type, file.filename ) ) { libspectrum_file_clear( &file ); return 1; } libspectrum_file_clear( &file ); return 0; } static int remove_block_type( libspectrum_tape *tape, libspectrum_tape_type id ) { libspectrum_tape_block* block; libspectrum_tape_iterator iterator; for( block = libspectrum_tape_iterator_init( &iterator, tape ); block; block = libspectrum_tape_iterator_next( &iterator ) ) { if( libspectrum_tape_block_type( block ) == id ) { libspectrum_tape_remove_block( tape, iterator ); /* Iterator is invalidated by delete, so start again */ block = libspectrum_tape_iterator_init( &iterator, tape ); } } return 0; } static int update_archive_file( char *archive_file, libspectrum_tape *tape ) { libspectrum_tape_block* info_block; libspectrum_error error; libspectrum_tape *tzx; libspectrum_tape_iterator iterator; if( read_tape( archive_file, &tzx ) ) return 1; /* Get the new archive block */ info_block = libspectrum_tape_iterator_init( &iterator, tzx ); while( info_block && libspectrum_tape_block_type( info_block ) != LIBSPECTRUM_TAPE_BLOCK_ARCHIVE_INFO ) { info_block = libspectrum_tape_iterator_next( &iterator ); } if( !info_block ) { libspectrum_tape_free( tzx ); return 1; } /* Remove any existing archive block */ error = remove_block_type( tape, LIBSPECTRUM_TAPE_BLOCK_ARCHIVE_INFO ); if( error ) { libspectrum_tape_free( tzx ); return error; } /* Finally, put the new info block at the beginning of the block list */ error = libspectrum_tape_insert_block( tape, info_block, 0 ); if( error ) { libspectrum_tape_free( tzx ); return error; } return 0; } static int append_scr_file( char *scr_file, libspectrum_tape *tape ) { libspectrum_tape_block* block; char *description; libspectrum_file scr; libspectrum_byte* custom_block_data; size_t custom_block_length; block = libspectrum_tape_block_alloc( LIBSPECTRUM_TAPE_BLOCK_CUSTOM ); /* Get the description */ description = malloc( DESCRIPTION_BUFFER_LEN ); memcpy( description, "Spectrum Screen ", DESCRIPTION_BUFFER_LEN ); libspectrum_tape_block_set_text( block, description ); /* Read in the data */ if( read_file( scr_file, &scr ) ) { free( description ); free( block ); return 1; } custom_block_length = scr.length + 2; custom_block_data = malloc( custom_block_length ); /* Picture description length 0 == "Loading Screen" */ custom_block_data[0] = 0; /* Border colour 0 == black */ custom_block_data[1] = 0; /* and the SCR itself */ memcpy( custom_block_data + 2, scr.buffer, scr.length ); libspectrum_file_clear( &scr ); libspectrum_tape_block_set_data_length( block, custom_block_length ); libspectrum_tape_block_set_data( block, custom_block_data ); /* Finally, put the block into the block list */ if( libspectrum_tape_append_block( tape, block ) ) { libspectrum_tape_block_free( block ); return 1; } return 0; } static int beautify_tzx_file( libspectrum_tape *tape ) { libspectrum_error error; /* Remove any existing concat blocks */ error = remove_block_type( tape, LIBSPECTRUM_TAPE_BLOCK_CONCAT ); if( error ) { return error; } return 0; } static int is_filetype( const char* new_filename, const char* type ) { return ( strlen( new_filename ) >= strlen(type) && !strcasecmp( new_filename + (strlen( new_filename ) - strlen(type) ), type ) ); } static int append_inlay_file( char *inlay_file, libspectrum_tape *tape ) { libspectrum_tape_block* block; char *description; libspectrum_file inlay; libspectrum_byte* custom_block_data; size_t custom_block_length; block = libspectrum_tape_block_alloc( LIBSPECTRUM_TAPE_BLOCK_CUSTOM ); /* Get the description */ description = malloc( DESCRIPTION_BUFFER_LEN ); memcpy( description, "Picture ", DESCRIPTION_BUFFER_LEN ); libspectrum_tape_block_set_text( block, description ); /* Read in the data */ if( read_file( inlay_file, &inlay ) ) { free( description ); free( block ); return 1; } custom_block_length = inlay.length + 2; custom_block_data = malloc( custom_block_length ); /* Picture format */ if( is_filetype( inlay_file, ".jpg" ) ) { custom_block_data[0] = 1; } else if( is_filetype( inlay_file, ".gif" ) ) { custom_block_data[0] = 0; } else { free( custom_block_data ); libspectrum_file_clear( &inlay ); return 1; } /* Picture description length 0 == "Inlay Card" */ custom_block_data[1] = 0; /* and the JPG itself */ memcpy( custom_block_data + 2, inlay.buffer, inlay.length ); libspectrum_file_clear( &inlay ); libspectrum_tape_block_set_data_length( block, custom_block_length ); libspectrum_tape_block_set_data( block, custom_block_data ); /* Finally, put the block into the block list */ if( libspectrum_tape_append_block( tape, block ) ) { libspectrum_tape_block_free( block ); return 1; } return 0; } static int write_tape( char *filename, libspectrum_tape *tape ) { libspectrum_byte *buffer = NULL; size_t length; libspectrum_id_t type; int error; if( get_type_from_string( &type, filename ) ) return 1; length = 0; if( libspectrum_tape_write( &buffer, &length, tape, type ) ) { fprintf( stderr, "%s: error converting tape for output '%s'\n", progname, filename ); free( buffer ); return 1; } if( type == LIBSPECTRUM_ID_TAPE_PZX && ( scr_file || inlay_file ) ) fprintf( stderr, "%s: warning: PZX output omits attachments added with %s\n", progname, scr_file ? ( inlay_file ? "-s and -i" : "-s" ) : "-i" ); error = write_file( filename, buffer, length ); if( error ) { free( buffer ); return 1; } free( buffer ); return 0; } fuse-utils-1.5.1/compat/0000775000175000017500000000000015271234221014116 5ustar00fredmfredmfuse-utils-1.5.1/compat/Makefile.am0000664000175000017500000000311515233351324016154 0ustar00fredmfredm## Process this file with automake to produce Makefile.in ## Copyright (c) 2013 Philip Kendall, Sergio Baldovi ## 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. ## ## Author contact information: ## ## E-mail: philip-fuse@shadowmagic.org.uk noinst_LIBRARIES += compat/libcompatos.a compat_libcompatos_a_SOURCES = if COMPAT_AMIGA compat_libcompatos_a_SOURCES += \ compat/amiga/basename.c \ compat/amiga/osname.c endif if COMPAT_UNIX compat_libcompatos_a_SOURCES += \ compat/unix/basename.c \ compat/unix/osname.c endif if COMPAT_WIN32 compat_libcompatos_a_SOURCES += \ compat/unix/basename.c \ compat/win32/osname.c endif EXTRA_DIST += \ compat/win32/check_win32_dll_deps.sh if COMPAT_WIN32 include compat/win32/distribution.mk endif fuse-utils-1.5.1/compat/getopt.c0000664000175000017500000010336415157611610015577 0ustar00fredmfredm/* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Modifications (c) 2003 Philip Kendall The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /* This tells Alpha OSF/1 not to define a getopt prototype in . Ditto for AIX 3.2 and . */ #ifndef _NO_PROTO # define _NO_PROTO #endif #ifdef HAVE_CONFIG_H # include "config.h" #endif #if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ # ifndef const # define const # endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 # include # if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION # define ELIDE_CODE # endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ /* Don't include stdlib.h for non-GNU C libraries because some of them contain conflicting prototypes for getopt. */ # include # include #endif /* GNU C library. */ #ifdef VMS # include # if HAVE_STRING_H - 0 # include # endif #endif #ifndef _ /* This is for other GNU distributions with internationalized messages. */ # if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC # include # ifndef _ # define _(msgid) gettext (msgid) # endif # else # define _(msgid) (msgid) # endif # if defined _LIBC && defined USE_IN_LIBIO # include # endif #endif #ifndef attribute_hidden # define attribute_hidden #endif /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "getopt.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Formerly, initialization of getopt depended on optind==0, which causes problems with re-calling getopt as programs generally don't know that. */ int __getopt_initialized attribute_hidden; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; /* Value of POSIXLY_CORRECT environment variable. */ static char *posixly_correct; #ifdef __GNU_LIBRARY__ /* We want to avoid inclusion of string.h with non-GNU libraries because there are many ways it can cause trouble. On some systems, it contains special magic macros that don't work in GCC. */ # include # define my_index strchr #else # if HAVE_STRING_H # include # else # include # endif /* Avoid depending on library functions or files whose names are inconsistent. */ #ifndef getenv extern char *getenv (); #endif static char * my_index (str, chr) const char *str; int chr; { while (*str) { if (*str == chr) return (char *) str; str++; } return 0; } /* If using GCC, we can safely declare strlen this way. If not using GCC, it is ok not to declare it. */ #ifdef __GNUC__ /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. That was relevant to code that was here before. */ # if (!defined __STDC__ || !__STDC__) && !defined strlen /* gcc with -traditional declares the built-in strlen to return int, and has done so at least since version 2.4.5. -- rms. */ extern int strlen (const char *); # endif /* not __STDC__ */ #endif /* __GNUC__ */ #endif /* not __GNU_LIBRARY__ */ /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; #ifdef _LIBC /* Stored original parameters. XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ extern int __libc_argc; extern char **__libc_argv; /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ # ifdef USE_NONOPTION_FLAGS /* Defined in getopt_init.c */ extern char *__getopt_nonoption_flags; static int nonoption_flags_max_len; static int nonoption_flags_len; # endif # ifdef USE_NONOPTION_FLAGS # define SWAP_FLAGS(ch1, ch2) \ if (nonoption_flags_len > 0) \ { \ char __tmp = __getopt_nonoption_flags[ch1]; \ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ __getopt_nonoption_flags[ch2] = __tmp; \ } # else # define SWAP_FLAGS(ch1, ch2) # endif #else /* !_LIBC */ # define SWAP_FLAGS(ch1, ch2) #endif /* _LIBC */ /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ #if defined __STDC__ && __STDC__ static void exchange (char **); #endif static void exchange (argv) char **argv; { int bottom = first_nonopt; int middle = last_nonopt; int top = optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ #if defined _LIBC && defined USE_NONOPTION_FLAGS /* First make sure the handling of the `__getopt_nonoption_flags' string can work normally. Our top argument must be in the range of the string. */ if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) { /* We must extend the array. The user plays games with us and presents new arguments. */ char *new_str = malloc (top + 1); if (new_str == NULL) nonoption_flags_len = nonoption_flags_max_len = 0; else { memset (__mempcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len), '\0', top + 1 - nonoption_flags_max_len); nonoption_flags_max_len = top + 1; __getopt_nonoption_flags = new_str; } } #endif while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; SWAP_FLAGS (bottom + i, middle + i); } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } /* Initialize the internal data when the first call is made. */ #if defined __STDC__ && __STDC__ static const char *_getopt_initialize (int, char *const *, const char *); #endif static const char * _getopt_initialize (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ first_nonopt = last_nonopt = optind; nextchar = NULL; posixly_correct = getenv ("POSIXLY_CORRECT"); /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (posixly_correct != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; #if defined _LIBC && defined USE_NONOPTION_FLAGS if (posixly_correct == NULL && argc == __libc_argc && argv == __libc_argv) { if (nonoption_flags_max_len == 0) { if (__getopt_nonoption_flags == NULL || __getopt_nonoption_flags[0] == '\0') nonoption_flags_max_len = -1; else { const char *orig_str = __getopt_nonoption_flags; int len = nonoption_flags_max_len = strlen (orig_str); if (nonoption_flags_max_len < argc) nonoption_flags_max_len = argc; __getopt_nonoption_flags = (char *) malloc (nonoption_flags_max_len); if (__getopt_nonoption_flags == NULL) nonoption_flags_max_len = -1; else memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), '\0', nonoption_flags_max_len - len); } } nonoption_flags_len = nonoption_flags_max_len; } else nonoption_flags_len = 0; #endif return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal (argc, argv, optstring, longopts, longind, long_only) int argc; char *const *argv; const char *optstring; const struct option *longopts; int *longind; int long_only; { int print_errors = opterr; if (optstring[0] == ':') print_errors = 0; if (argc < 1) return -1; optarg = NULL; if (optind == 0 || !__getopt_initialized) { if (optind == 0) optind = 1; /* Don't scan ARGV[0], the program name. */ optstring = _getopt_initialize (argc, argv, optstring); __getopt_initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #if defined _LIBC && defined USE_NONOPTION_FLAGS # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ || (optind < nonoption_flags_len \ && __getopt_nonoption_flags[optind] == '1')) #else # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') #endif if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (last_nonopt > optind) last_nonopt = optind; if (first_nonopt > optind) first_nonopt = optind; if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (last_nonopt != optind) first_nonopt = optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && NONOPTION_P) optind++; last_nonopt = optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp (argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) return -1; optarg = argv[optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[optind][1] == '-' || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == (unsigned int) strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else if (long_only || pfound->has_arg != p->has_arg || pfound->flag != p->flag || pfound->val != p->val) /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]) >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #else fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); #endif } nextchar += strlen (nextchar); optind++; optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; int n; #endif if (argv[optind - 1][1] == '-') { /* --option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("\ %s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); #else fprintf (stderr, _("\ %s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); #endif } else { /* +option or -option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("\ %s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); #else fprintf (stderr, _("\ %s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #endif } nextchar += strlen (nextchar); optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]) >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #else fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); #endif } nextchar += strlen (nextchar); optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[optind][1] == '-' || my_index (optstring, *nextchar) == NULL) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; int n; #endif if (argv[optind][1] == '-') { /* --option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); #else fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); #endif } else { /* +option or -option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); #else fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #endif } nextchar = (char *) ""; optind++; optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *nextchar++; char *temp = my_index (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == '\0') ++optind; if (temp == NULL || c == ':') { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; int n; #endif if (posixly_correct) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: illegal option -- %c\n"), argv[0], c); #else fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); #endif } else { #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: invalid option -- %c\n"), argv[0], c); #else fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #endif } optopt = c; return '?'; } /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("%s: option requires an argument -- %c\n"), argv[0], c) >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #else fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); #endif } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return c; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[optind]) >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #else fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[optind]); #endif } nextchar += strlen (nextchar); optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name) >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #else fprintf (stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); #endif } nextchar += strlen (nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]) >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #else fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); #endif } nextchar += strlen (nextchar); return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } nextchar = NULL; return 'W'; /* Let the application handle it. */ } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = NULL; nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option requires an argument -- %c\n"), argv[0], c) >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #else fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); #endif } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = NULL; } } return c; } } int getopt (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { return _getopt_internal (argc, argv, optstring, (const struct option *) 0, (int *) 0, 0); } #endif /* Not ELIDE_CODE. */ #ifdef TEST /* Compile with -DTEST to make an executable for use in testing the above definition of `getopt'. */ int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; c = getopt (argc, argv, "abc:d:0123456789"); if (c == -1) break; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ fuse-utils-1.5.1/compat/unix/0000775000175000017500000000000015271234221015101 5ustar00fredmfredmfuse-utils-1.5.1/compat/unix/osname.c0000664000175000017500000000263415157611610016540 0ustar00fredmfredm/* osname.c: Get a representation of the OS we're running on Copyright (c) 1999-2007 Philip Kendall 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. Author contact information: E-mail: philip-fuse@shadowmagic.org.uk */ #include "config.h" #include #include #include #include #include #include "compat.h" extern char *progname; int compat_osname( char *buffer, size_t length ) { struct utsname osname; int error; error = uname( &osname ); if( error < 0 ) { fprintf( stderr, "%s: error getting system information: %s", progname, strerror( errno ) ); return 1; } snprintf( buffer, length, "%s %s %s", osname.sysname, osname.machine, osname.release ); return 0; } fuse-utils-1.5.1/compat/unix/basename.c0000664000175000017500000000177515157611610017036 0ustar00fredmfredm/* basename.c: Extract the base portion of a pathname Copyright (c) 1999-2007 Philip Kendall 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. Author contact information: E-mail: philip-fuse@shadowmagic.org.uk */ #include "config.h" #include #include "compat.h" char * compat_basename( char *path ) { return basename( path ); } fuse-utils-1.5.1/compat/getopt.h0000664000175000017500000001447715157611610015612 0ustar00fredmfredm/* Declarations for getopt. Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef _GETOPT_H #ifndef __need_getopt # define _GETOPT_H 1 #endif /* If __GNU_LIBRARY__ is not already defined, either we are being used standalone, or this is the first header included in the source file. If we are being used with glibc, we need to include , but that does not exist if we are standalone. So: if __GNU_LIBRARY__ is not defined, include , which will pull in for us if it's from glibc. (Why ctype.h? It's guaranteed to exist and it doesn't flood the namespace with stuff the way some other headers do.) */ #if !defined __GNU_LIBRARY__ # include #endif #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; #ifndef __need_getopt /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { # if (defined __STDC__ && __STDC__) || defined __cplusplus const char *name; # else char *name; # endif /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ # define no_argument 0 # define required_argument 1 # define optional_argument 2 #endif /* need getopt */ /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. Return the option character from OPTS just read. Return -1 when there are no more options. For unrecognized options, or options missing arguments, `optopt' is set to the option letter, and '?' is returned. The OPTS string is a list of characters which are recognized option letters, optionally followed by colons, specifying that that letter takes an argument, to be placed in `optarg'. If a letter in OPTS is followed by two colons, its argument is optional. This behavior is specific to the GNU `getopt'. The argument `--' causes premature termination of argument scanning, explicitly telling `getopt' that there are no more options. If OPTS begins with `--', then non-option arguments are treated as arguments to the option '\0'. This behavior is specific to the GNU `getopt'. */ #if (defined __STDC__ && __STDC__) || defined __cplusplus # ifdef __GNU_LIBRARY__ /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt (int ___argc, char *const *___argv, const char *__shortopts); # else /* not __GNU_LIBRARY__ */ extern int getopt (); # endif /* __GNU_LIBRARY__ */ # ifndef __need_getopt extern int getopt_long (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind); extern int getopt_long_only (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind); /* Internal only. Users should not call this directly. */ extern int _getopt_internal (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only); # endif #else /* not __STDC__ */ extern int getopt (); # ifndef __need_getopt extern int getopt_long (); extern int getopt_long_only (); extern int _getopt_internal (); # endif #endif /* __STDC__ */ #ifdef __cplusplus } #endif /* Make sure we later can get all the definitions and declarations. */ #undef __need_getopt #endif /* getopt.h */ fuse-utils-1.5.1/compat/getopt1.c0000664000175000017500000001115015157611610015647 0ustar00fredmfredm/* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 Free Software Foundation, Inc. This file is part of the GNU C Library. Modifications copyright (c) 2003 Philip Kendall The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef _LIBC # include #else # include "getopt.h" #endif #if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 #include #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include #endif #ifndef NULL #define NULL 0 #endif int getopt_long (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 1); } # ifdef _LIBC libc_hidden_def (getopt_long) libc_hidden_def (getopt_long_only) # endif #endif /* Not ELIDE_CODE. */ #ifdef TEST #include int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; int option_index = 0; static struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, {"delete", 1, 0, 0}, {"verbose", 0, 0, 0}, {"create", 0, 0, 0}, {"file", 1, 0, 0}, {0, 0, 0, 0} }; c = getopt_long (argc, argv, "abc:d:0123456789", long_options, &option_index); if (c == -1) break; switch (c) { case 0: printf ("option %s", long_options[option_index].name); if (optarg) printf (" with arg %s", optarg); printf ("\n"); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case 'd': printf ("option d with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ fuse-utils-1.5.1/compat/win32/0000775000175000017500000000000015271234221015060 5ustar00fredmfredmfuse-utils-1.5.1/compat/win32/osname.c0000664000175000017500000000361015157611610016512 0ustar00fredmfredm/* osname.c: Get a representation of the OS we're running on Copyright (c) 2011 Philip Kendall 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. Author contact information: E-mail: philip-fuse@shadowmagic.org.uk */ #include "config.h" #include #include #include "compat.h" extern char *progname; int compat_osname( char *osname, size_t length ) { OSVERSIONINFO buf; const char *windows_name; int error; buf.dwOSVersionInfoSize = sizeof( buf ); error = GetVersionEx( &buf ); if( error == 0 ) { fprintf( stderr, "%s: error getting system information: %s", progname, strerror( errno ) ); return 1; } switch( buf.dwPlatformId ) { case VER_PLATFORM_WIN32_NT: windows_name = "NT"; break; case VER_PLATFORM_WIN32_WINDOWS: windows_name = "95/98"; break; case VER_PLATFORM_WIN32s: windows_name = "3.1"; break; default: windows_name = "unknown"; break; } /* The casts to int work around a suspected Wine (or MinGW) bug */ snprintf( osname, length, "Windows %s %i.%i build %i %s", windows_name, (int)buf.dwMajorVersion, (int)buf.dwMinorVersion, (int)buf.dwBuildNumber, buf.szCSDVersion ); return 0; } fuse-utils-1.5.1/compat/win32/distribution.mk0000664000175000017500000001035715201724301020132 0ustar00fredmfredm## This file does not need automake. Include in the final Makefile. ## Copyright (c) 2013-2015 Sergio Baldoví ## 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. ## ## Author contact information: ## ## E-mail: serbalgi@gmail.com package_win32=$(PACKAGE)-$(PACKAGE_VERSION)-win32 top_win32dir=$(top_builddir)/$(package_win32) install-win32: all test -n "$(DESTDIR)" || { echo "ERROR: set DESTDIR path"; exit 1; } $(MKDIR_P) $(DESTDIR)/ || exit 1 # Copy executables list='$(bin_PROGRAMS)'; \ for file in $$list; do \ if test -f "$(top_builddir)/.libs/$$file"; then \ cp "$(top_builddir)/.libs/$$file" $(DESTDIR); \ else \ cp "$(top_builddir)/$$file" $(DESTDIR); \ fi; \ done # Copy required DLLs from sysroot, following DLL dependencies recursively. # Only scan shipped top-level binaries. bash "$(top_srcdir)/compat/win32/check_win32_dll_deps.sh" "$(DESTDIR)" # Get text files for file in AUTHORS ChangeLog COPYING README; \ do cp "$(top_srcdir)/$$file" "$(DESTDIR)/$$file.txt"; \ done # Get manuals topsrcdirstrip=`echo "$(top_srcdir)/man" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ man_files=`for file in $(top_srcdir)/man/*.1; do echo "$$file"; done | \ sed -e "s|^$$topsrcdirstrip/||" -e "s|.1$$||"`; \ for file in $$man_files; do \ if test -n "$(GROFF)"; then \ $(GROFF) -Thtml -man "$(top_srcdir)/man/$$file.1" > "$(DESTDIR)/$$file.html"; \ elif test -n "$(MAN2HTML)"; then \ $(MAN2HTML) -r "$(top_srcdir)/man/$$file.1" | \ sed '1d' > "$(DESTDIR)/$$file.html"; \ fi; \ done # Convert to DOS line endings test -z "$(UNIX2DOS)" || find $(DESTDIR) -type f \( -name "*txt" -or -name "*html" \) -exec $(UNIX2DOS) -q {} \; install-win32-strip: install-win32 test -z "$(STRIP)" || { list='$(bin_PROGRAMS)'; \ for file in $$list; do \ test -z "$(STRIP)" || $(STRIP) "$(DESTDIR)/$$file"; \ done } dist-win32-dir: $(MAKE) DESTDIR="$(top_win32dir)" install-win32-strip dist-win32-zip: dist-win32-dir rm -f -- $(top_builddir)/$(package_win32).zip rm -f -- $(top_builddir)/$(package_win32).zip.sha1 test -n "$(top_win32dir)" || exit 1 @test `find $(top_win32dir) -type f -name \*.dll -print | wc -l` -ne 0 || \ { echo "ERROR: external libraries not found in $(top_win32dir). Please, manually copy them."; exit 1; } cd $(top_win32dir) && \ zip -q -9 -r $(abs_top_builddir)/$(package_win32).zip . -sha1sum $(top_builddir)/$(package_win32).zip > $(top_builddir)/$(package_win32).zip.sha1 && \ { test -z "$(UNIX2DOS)" || $(UNIX2DOS) $(top_builddir)/$(package_win32).zip.sha1; } dist-win32-7z: dist-win32-dir rm -f -- $(top_builddir)/$(package_win32).7z rm -f -- $(top_builddir)/$(package_win32).7z.sha1 test -n "$(top_win32dir)" || exit 1 @test `find $(top_win32dir) -type f -name \*.dll -print | wc -l` -ne 0 || \ { echo "ERROR: external libraries not found in $(top_win32dir). Please, manually copy them."; exit 1; } cd $(top_win32dir) && \ 7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on -bd $(abs_top_builddir)/$(package_win32).7z . -sha1sum $(top_builddir)/$(package_win32).7z > $(top_builddir)/$(package_win32).7z.sha1 && \ { test -z "$(UNIX2DOS)" || $(UNIX2DOS) $(top_builddir)/$(package_win32).7z.sha1; } dist-win32: dist-win32-zip dist-win32-7z distclean-win32: if test -d "$(top_builddir)/$(package_win32)"; then \ rm -rf -- "$(top_builddir)/$(package_win32)"; \ fi rm -f -- $(top_builddir)/$(package_win32).zip rm -f -- $(top_builddir)/$(package_win32).zip.sha1 rm -f -- $(top_builddir)/$(package_win32).7z rm -f -- $(top_builddir)/$(package_win32).7z.sha1 .PHONY: install-win32 install-win32-strip \ dist-win32 dist-win32-dir dist-win32-zip dist-win32-7z distclean-win32 fuse-utils-1.5.1/compat/win32/check_win32_dll_deps.sh0000664000175000017500000000437715233351324021376 0ustar00fredmfredm#!/usr/bin/env bash set -u root_dir=${1:-} if [ -z "$root_dir" ] || [ ! -d "$root_dir" ]; then echo "Usage: $0 " >&2 exit 1 fi is_system_dll() { case "$1" in kernel32.dll|user32.dll|gdi32.dll|advapi32.dll|shell32.dll|ole32.dll| \ oleaut32.dll|uuid.dll|ws2_32.dll|comdlg32.dll|winmm.dll|version.dll| \ msvcrt.dll|bcrypt.dll|ntdll.dll|shlwapi.dll|crypt32.dll|dbghelp.dll| \ psapi.dll|iphlpapi.dll|secur32.dll|setupapi.dll|imm32.dll|mpr.dll| \ winspool.drv|api-ms-win-*|ext-ms-*|comctl32.dll|dwmapi.dll|dnsapi.dll| \ dwrite.dll|gdiplus.dll|hid.dll|msimg32.dll|opengl32.dll|rpcrt4.dll|usp10.dll) return 0 ;; esac return 1 } search_dirs=( "$root_dir" /usr/local/i686-w64-mingw32/bin /usr/i686-w64-mingw32/sys-root/mingw/bin /usr/i686-w64-mingw32/sys-root/mingw/system32 /usr/local/i686-w64-mingw32/system32 /usr/i686-pc-mingw32/sys-root/mingw/bin /usr/i686-pc-mingw32/sys-root/mingw/system32 ) if [ -n "${CYGWIN_LIBDIR:-}" ]; then search_dirs+=("${CYGWIN_LIBDIR%/}") fi # MSYS2 toolchain if [ -n "${MSYSTEM_PREFIX:-}" ]; then search_dirs+=("${MSYSTEM_PREFIX}/bin") fi if [ -n "${WIN32_DLL_SEARCH_DIRS:-}" ]; then # shellcheck disable=SC2206 extra_dirs=(${WIN32_DLL_SEARCH_DIRS}) search_dirs+=("${extra_dirs[@]}") fi find_binaries() { if [ "${WIN32_DLL_DEPS_SCAN_EXES:-1}" = 0 ]; then find "$root_dir" -maxdepth 1 -type f -name '*.dll' -print else find "$root_dir" -maxdepth 1 -type f \( -name '*.exe' -o -name '*.dll' \) -print fi } changed=1 while [ "$changed" -ne 0 ]; do changed=0 while IFS= read -r file; do while IFS= read -r dll; do dll_lc=$(printf '%s' "$dll" | tr '[:upper:]' '[:lower:]') if is_system_dll "$dll_lc"; then continue fi if [ -f "$root_dir/$dll" ]; then continue fi found=0 for searchdir in "${search_dirs[@]}"; do if [ -f "$searchdir/$dll" ]; then cp -f "$searchdir/$dll" "$root_dir/" changed=1 found=1 break fi done if [ "$found" -eq 0 ]; then echo "Missing dependency for ${file}: ${dll}" >&2 exit 1 fi done < <( objdump -p "$file" 2>/dev/null | grep 'DLL Name' | sed 's/.*DLL Name: //' ) done < <(find_binaries) done fuse-utils-1.5.1/compat/amiga/0000775000175000017500000000000015271234221015174 5ustar00fredmfredmfuse-utils-1.5.1/compat/amiga/osname.c0000664000175000017500000000327515157611610016635 0ustar00fredmfredm/* osname.c: Get a representation of the OS we're running on Copyright (c) 1999-2007 Philip Kendall 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. Author contact information: E-mail: philip-fuse@shadowmagic.org.uk */ #include "config.h" #include #include #include #include #include #include "compat.h" struct Library *ExpansionBase; struct ExpansionIFace *IExpansion; int compat_osname( char *buffer, size_t length ) { STRPTR machine; if( ExpansionBase = IExec->OpenLibrary( "expansion.library", 52 ) ) { if( IExpansion = ( struct ExpansionIFace * ) IExec->GetInterface( ExpansionBase,"main",1,NULL ) ) { IExpansion->GetMachineInfoTags( GMIT_MachineString, &machine, TAG_DONE ); snprintf( buffer, length, "%s %s %s", "AmigaOS", machine, "4.0" ); IExec->DropInterface( ( struct Interface * )IExpansion ); } IExec->CloseLibrary( ExpansionBase ); } else { return 1; } return 0; } fuse-utils-1.5.1/compat/amiga/basename.c0000664000175000017500000000200115157611610017110 0ustar00fredmfredm/* basename.c: Extract the base portion of a pathname Copyright (c) 2008 Chris Young 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. Author contact information: E-mail: philip-fuse@shadowmagic.org.uk */ #include "config.h" #include #include "compat.h" char * compat_basename( char *path ) { return( IDOS->FilePart( path ) ); } fuse-utils-1.5.1/README0000664000175000017500000000541015267623700013524 0ustar00fredmfredmThe Fuse utilities version 1.5.0 ================================ The Fuse utilities are a few tools which may be of occasional use when dealing with ZX Spectrum emulator files. They were originally distributed with Fuse, the Free Unix Spectrum Emulator, but are now independent of Fuse and can be used on their own. The available utilities are: * audio2tape: convert an audio file to tape format. * createhdf: create an empty .hdf IDE hard disk image. * fmfconv: converter tool for FMF movie files. * listbasic: list the BASIC in a snapshot, tape or Microdrive cartridge file. * mdrlist: list the contents of an MDR Microdrive cartridge image. * profile2map: convert Fuse profiler output to Z80-style map format. * raw2hdf: create a .hdf IDE hard disk image from another file. * rzxcheck: verify the digital signature in an RZX file. * rzxdump: list the contents of an RZX input recording file. * rzxtool: add, extract or remove the embedded snapshot from an RZX file, or compress or uncompress the file. * scl2trd: convert .scl disk images to .trd disk images. * snap2tzx: convert snapshots to TZX tape images. * snapconv: convert between snapshot formats. * snapdump: list information about machine status stored in a snapshot file. * tape2pulses: dumps the pulse information from tape images to text files. * tape2wav: convert a tape file to .wav audio format. * tapeconv: convert between tape image formats, including TZX, TAP, PZX and CSW. * tzxlist: list the contents of a TZX, TAP, PZX or Warajevo TAP file. In order to use the utilities, you'll need `libspectrum' installed; this is available from: http://fuse-emulator.sourceforge.net/libspectrum.php If you want to deal with compressed RZX files, you'll also need `zlib' installed. Once you've got any libraries installed, building the utilities should be as simple as: $ ./configure $ make and then $ make install By default, the utilities will be installed in `/usr/local', so you'll probably have to be root to do the last step. If you want to change this, give the `--prefix=DIR' option to `configure' to install them under `DIR'. The latest version of the utilities should always be available from http://fuse-emulator.sourceforge.net/fuse.php If you're having a problem using/running/building fuse-utils, the two places you're most likely to get help are the development mailing list or the official forums at . Compiling from Git ------------------ If you're using version of fuse-utils from Git rather than one of the released tarballs, you'll need to run `autogen.sh' before running 'configure' for the first time. Maintainer release notes are in `hacking/releasing.md'. Philip Kendall 17th October, 2026 fuse-utils-1.5.1/movie_tables.h0000664000175000017500000021471715157611610015475 0ustar00fredmfredm/* movie_tables.h: u-law, a-law tables for pcm <--> law conversions Copyright (c) 2006 Gergely Szasz 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. Author contact information: E-mail: philip-fuse@shadowmagic.org.uk */ #define U_BIAS 0x0084 #define U_CLIP 0x7f7b /* libspectrum_signed_word ulaw_table[256] */ #define ULAW_TAB \ -32124, -31100, -30076, -29052, -28028, -27004, -25980, -24956, \ -23932, -22908, -21884, -20860, -19836, -18812, -17788, -16764, \ -15996, -15484, -14972, -14460, -13948, -13436, -12924, -12412, \ -11900, -11388, -10876, -10364, -9852, -9340, -8828, -8316, \ -7932, -7676, -7420, -7164, -6908, -6652, -6396, -6140, \ -5884, -5628, -5372, -5116, -4860, -4604, -4348, -4092, \ -3900, -3772, -3644, -3516, -3388, -3260, -3132, -3004, \ -2876, -2748, -2620, -2492, -2364, -2236, -2108, -1980, \ -1884, -1820, -1756, -1692, -1628, -1564, -1500, -1436, \ -1372, -1308, -1244, -1180, -1116, -1052, -988, -924, \ -876, -844, -812, -780, -748, -716, -684, -652, \ -620, -588, -556, -524, -492, -460, -428, -396, \ -372, -356, -340, -324, -308, -292, -276, -260, \ -244, -228, -212, -196, -180, -164, -148, -132, \ -120, -112, -104, -96, -88, -80, -72, -64, \ -56, -48, -40, -32, -24, -16, -8, 0, \ 32124, 31100, 30076, 29052, 28028, 27004, 25980, 24956, \ 23932, 22908, 21884, 20860, 19836, 18812, 17788, 16764, \ 15996, 15484, 14972, 14460, 13948, 13436, 12924, 12412, \ 11900, 11388, 10876, 10364, 9852, 9340, 8828, 8316, \ 7932, 7676, 7420, 7164, 6908, 6652, 6396, 6140, \ 5884, 5628, 5372, 5116, 4860, 4604, 4348, 4092, \ 3900, 3772, 3644, 3516, 3388, 3260, 3132, 3004, \ 2876, 2748, 2620, 2492, 2364, 2236, 2108, 1980, \ 1884, 1820, 1756, 1692, 1628, 1564, 1500, 1436, \ 1372, 1308, 1244, 1180, 1116, 1052, 988, 924, \ 876, 844, 812, 780, 748, 716, 684, 652, \ 620, 588, 556, 524, 492, 460, 428, 396, \ 372, 356, 340, 324, 308, 292, 276, 260, \ 244, 228, 212, 196, 180, 164, 148, 132, \ 120, 112, 104, 96, 88, 80, 72, 64, \ 56, 48, 40, 32, 24, 16, 8, 0 /* libspectrum_signed_word alaw_table[256] */ #define ALAW_TAB \ -5504, -5248, -6016, -5760, -4480, -4224, -4992, -4736, \ -7552, -7296, -8064, -7808, -6528, -6272, -7040, -6784, \ -2752, -2624, -3008, -2880, -2240, -2112, -2496, -2368, \ -3776, -3648, -4032, -3904, -3264, -3136, -3520, -3392, \ -22016, -20992, -24064, -23040, -17920, -16896, -19968, -18944, \ -30208, -29184, -32256, -31232, -26112, -25088, -28160, -27136, \ -11008, -10496, -12032, -11520, -8960, -8448, -9984, -9472, \ -15104, -14592, -16128, -15616, -13056, -12544, -14080, -13568, \ -344, -328, -376, -360, -280, -264, -312, -296, \ -472, -456, -504, -488, -408, -392, -440, -424, \ -88, -72, -120, -104, -24, -8, -56, -40, \ -216, -200, -248, -232, -152, -136, -184, -168, \ -1376, -1312, -1504, -1440, -1120, -1056, -1248, -1184, \ -1888, -1824, -2016, -1952, -1632, -1568, -1760, -1696, \ -688, -656, -752, -720, -560, -528, -624, -592, \ -944, -912, -1008, -976, -816, -784, -880, -848, \ 5504, 5248, 6016, 5760, 4480, 4224, 4992, 4736, \ 7552, 7296, 8064, 7808, 6528, 6272, 7040, 6784, \ 2752, 2624, 3008, 2880, 2240, 2112, 2496, 2368, \ 3776, 3648, 4032, 3904, 3264, 3136, 3520, 3392, \ 22016, 20992, 24064, 23040, 17920, 16896, 19968, 18944, \ 30208, 29184, 32256, 31232, 26112, 25088, 28160, 27136, \ 11008, 10496, 12032, 11520, 8960, 8448, 9984, 9472, \ 15104, 14592, 16128, 15616, 13056, 12544, 14080, 13568, \ 344, 328, 376, 360, 280, 264, 312, 296, \ 472, 456, 504, 488, 408, 392, 440, 424, \ 88, 72, 120, 104, 24, 8, 56, 40, \ 216, 200, 248, 232, 152, 136, 184, 168, \ 1376, 1312, 1504, 1440, 1120, 1056, 1248, 1184, \ 1888, 1824, 2016, 1952, 1632, 1568, 1760, 1696, \ 688, 656, 752, 720, 560, 528, 624, 592, \ 944, 912, 1008, 976, 816, 784, 880, 848 /* static unsigned char alaw_enc_table[2048 + 1] */ #define ALAW_ENC_TAB \ 0xd5, 0xd4, 0xd7, 0xd6, 0xd1, 0xd0, 0xd3, 0xd2, 0xdd, 0xdc, 0xdf, 0xde, \ 0xd9, 0xd8, 0xdb, 0xda, 0xc5, 0xc4, 0xc7, 0xc6, 0xc1, 0xc0, 0xc3, 0xc2, \ 0xcd, 0xcc, 0xcf, 0xce, 0xc9, 0xc8, 0xcb, 0xca, 0xf5, 0xf5, 0xf4, 0xf4, \ 0xf7, 0xf7, 0xf6, 0xf6, 0xf1, 0xf1, 0xf0, 0xf0, 0xf3, 0xf3, 0xf2, 0xf2, \ 0xfd, 0xfd, 0xfc, 0xfc, 0xff, 0xff, 0xfe, 0xfe, 0xf9, 0xf9, 0xf8, 0xf8, \ 0xfb, 0xfb, 0xfa, 0xfa, 0xe5, 0xe5, 0xe5, 0xe5, 0xe4, 0xe4, 0xe4, 0xe4, \ 0xe7, 0xe7, 0xe7, 0xe7, 0xe6, 0xe6, 0xe6, 0xe6, 0xe1, 0xe1, 0xe1, 0xe1, \ 0xe0, 0xe0, 0xe0, 0xe0, 0xe3, 0xe3, 0xe3, 0xe3, 0xe2, 0xe2, 0xe2, 0xe2, \ 0xed, 0xed, 0xed, 0xed, 0xec, 0xec, 0xec, 0xec, 0xef, 0xef, 0xef, 0xef, \ 0xee, 0xee, 0xee, 0xee, 0xe9, 0xe9, 0xe9, 0xe9, 0xe8, 0xe8, 0xe8, 0xe8, \ 0xeb, 0xeb, 0xeb, 0xeb, 0xea, 0xea, 0xea, 0xea, 0x95, 0x95, 0x95, 0x95, \ 0x95, 0x95, 0x95, 0x95, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, \ 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x96, 0x96, 0x96, 0x96, \ 0x96, 0x96, 0x96, 0x96, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, \ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x93, 0x93, 0x93, 0x93, \ 0x93, 0x93, 0x93, 0x93, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, \ 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9c, 0x9c, 0x9c, 0x9c, \ 0x9c, 0x9c, 0x9c, 0x9c, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, \ 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x99, 0x99, 0x99, 0x99, \ 0x99, 0x99, 0x99, 0x99, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, \ 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9a, 0x9a, 0x9a, 0x9a, \ 0x9a, 0x9a, 0x9a, 0x9a, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, \ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x84, 0x84, 0x84, 0x84, \ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, \ 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, \ 0x87, 0x87, 0x87, 0x87, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, \ 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x81, 0x81, 0x81, 0x81, \ 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, \ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x82, 0x82, 0x82, 0x82, \ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, \ 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, \ 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x88, 0x88, 0x88, 0x88, \ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, \ 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0xb5, 0xb5, 0xb5, 0xb5, \ 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, \ 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, \ 0xb5, 0xb5, 0xb5, 0xb5, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, \ 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, \ 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, \ 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, \ 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, \ 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb6, 0xb6, 0xb6, 0xb6, \ 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, \ 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, \ 0xb6, 0xb6, 0xb6, 0xb6, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, \ 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, \ 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, \ 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, \ 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, \ 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb3, 0xb3, 0xb3, 0xb3, \ 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, \ 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, \ 0xb3, 0xb3, 0xb3, 0xb3, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, \ 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, \ 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, \ 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, \ 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, \ 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbc, 0xbc, 0xbc, 0xbc, \ 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, \ 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, \ 0xbc, 0xbc, 0xbc, 0xbc, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, \ 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, \ 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, \ 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, \ 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, \ 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xb9, 0xb9, 0xb9, 0xb9, \ 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, \ 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, \ 0xb9, 0xb9, 0xb9, 0xb9, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, \ 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, \ 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, \ 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, \ 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, \ 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xba, 0xba, 0xba, 0xba, \ 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, \ 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, \ 0xba, 0xba, 0xba, 0xba, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, \ 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, \ 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, \ 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, \ 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, \ 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa4, 0xa4, 0xa4, 0xa4, \ 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, \ 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, \ 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, \ 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, \ 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, \ 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, \ 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, \ 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, \ 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, \ 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, \ 0xa7, 0xa7, 0xa7, 0xa7, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, \ 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, \ 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, \ 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, \ 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, \ 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa1, 0xa1, 0xa1, 0xa1, \ 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, \ 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, \ 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, \ 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, \ 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, \ 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, \ 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, \ 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, \ 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, \ 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, \ 0xa0, 0xa0, 0xa0, 0xa0, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, \ 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, \ 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, \ 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, \ 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, \ 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa2, 0xa2, 0xa2, 0xa2, \ 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, \ 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, \ 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, \ 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, \ 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, \ 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, \ 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, \ 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, \ 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, \ 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, \ 0xad, 0xad, 0xad, 0xad, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, \ 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, \ 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, \ 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, \ 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, \ 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xaf, 0xaf, 0xaf, 0xaf, \ 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, \ 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, \ 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, \ 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, \ 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, \ 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, \ 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, \ 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, \ 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, \ 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, \ 0xae, 0xae, 0xae, 0xae, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, \ 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, \ 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, \ 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, \ 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, \ 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa8, 0xa8, 0xa8, 0xa8, \ 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, \ 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, \ 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, \ 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, \ 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, \ 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, \ 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, \ 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, \ 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, \ 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, \ 0xab, 0xab, 0xab, 0xab, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, \ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, \ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, \ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, \ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, \ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x2a /* static unsigned char ulaw_enc_table[8192 + 1] */ #define ULAW_ENC_TAB \ 0xff, 0xfe, 0xfe, 0xfd, 0xfd, 0xfc, 0xfc, 0xfb, 0xfb, 0xfa, 0xfa, 0xf9, \ 0xf9, 0xf8, 0xf8, 0xf7, 0xf7, 0xf6, 0xf6, 0xf5, 0xf5, 0xf4, 0xf4, 0xf3, \ 0xf3, 0xf2, 0xf2, 0xf1, 0xf1, 0xf0, 0xf0, 0xef, 0xef, 0xef, 0xef, 0xee, \ 0xee, 0xee, 0xee, 0xed, 0xed, 0xed, 0xed, 0xec, 0xec, 0xec, 0xec, 0xeb, \ 0xeb, 0xeb, 0xeb, 0xea, 0xea, 0xea, 0xea, 0xe9, 0xe9, 0xe9, 0xe9, 0xe8, \ 0xe8, 0xe8, 0xe8, 0xe7, 0xe7, 0xe7, 0xe7, 0xe6, 0xe6, 0xe6, 0xe6, 0xe5, \ 0xe5, 0xe5, 0xe5, 0xe4, 0xe4, 0xe4, 0xe4, 0xe3, 0xe3, 0xe3, 0xe3, 0xe2, \ 0xe2, 0xe2, 0xe2, 0xe1, 0xe1, 0xe1, 0xe1, 0xe0, 0xe0, 0xe0, 0xe0, 0xdf, \ 0xdf, 0xdf, 0xdf, 0xdf, 0xdf, 0xdf, 0xdf, 0xde, 0xde, 0xde, 0xde, 0xde, \ 0xde, 0xde, 0xde, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdc, \ 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, \ 0xdb, 0xdb, 0xdb, 0xda, 0xda, 0xda, 0xda, 0xda, 0xda, 0xda, 0xda, 0xd9, \ 0xd9, 0xd9, 0xd9, 0xd9, 0xd9, 0xd9, 0xd9, 0xd8, 0xd8, 0xd8, 0xd8, 0xd8, \ 0xd8, 0xd8, 0xd8, 0xd7, 0xd7, 0xd7, 0xd7, 0xd7, 0xd7, 0xd7, 0xd7, 0xd6, \ 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd5, 0xd5, 0xd5, 0xd5, 0xd5, \ 0xd5, 0xd5, 0xd5, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd3, \ 0xd3, 0xd3, 0xd3, 0xd3, 0xd3, 0xd3, 0xd3, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, \ 0xd2, 0xd2, 0xd2, 0xd1, 0xd1, 0xd1, 0xd1, 0xd1, 0xd1, 0xd1, 0xd1, 0xd0, \ 0xd0, 0xd0, 0xd0, 0xd0, 0xd0, 0xd0, 0xd0, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, \ 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xce, \ 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, \ 0xce, 0xce, 0xce, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, \ 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, \ 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcb, \ 0xcb, 0xcb, 0xcb, 0xcb, 0xcb, 0xcb, 0xcb, 0xcb, 0xcb, 0xcb, 0xcb, 0xcb, \ 0xcb, 0xcb, 0xcb, 0xca, 0xca, 0xca, 0xca, 0xca, 0xca, 0xca, 0xca, 0xca, \ 0xca, 0xca, 0xca, 0xca, 0xca, 0xca, 0xca, 0xc9, 0xc9, 0xc9, 0xc9, 0xc9, \ 0xc9, 0xc9, 0xc9, 0xc9, 0xc9, 0xc9, 0xc9, 0xc9, 0xc9, 0xc9, 0xc9, 0xc8, \ 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, \ 0xc8, 0xc8, 0xc8, 0xc7, 0xc7, 0xc7, 0xc7, 0xc7, 0xc7, 0xc7, 0xc7, 0xc7, \ 0xc7, 0xc7, 0xc7, 0xc7, 0xc7, 0xc7, 0xc7, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, \ 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc5, \ 0xc5, 0xc5, 0xc5, 0xc5, 0xc5, 0xc5, 0xc5, 0xc5, 0xc5, 0xc5, 0xc5, 0xc5, \ 0xc5, 0xc5, 0xc5, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, \ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, \ 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc2, \ 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, \ 0xc2, 0xc2, 0xc2, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, \ 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, \ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xbf, \ 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, \ 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, \ 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, \ 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, \ 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, \ 0xbe, 0xbe, 0xbe, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, \ 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, \ 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbc, \ 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, \ 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, \ 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, \ 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, \ 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, \ 0xbb, 0xbb, 0xbb, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, \ 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, \ 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xb9, \ 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, \ 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, \ 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, \ 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, \ 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, \ 0xb8, 0xb8, 0xb8, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, \ 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, \ 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb6, \ 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, \ 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, \ 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, \ 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, \ 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, \ 0xb5, 0xb5, 0xb5, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, \ 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, \ 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb3, \ 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, \ 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, \ 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, \ 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, \ 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, \ 0xb2, 0xb2, 0xb2, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, \ 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, \ 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb0, \ 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, \ 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, \ 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, \ 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, \ 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, \ 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, \ 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, \ 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xae, \ 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, \ 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, \ 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, \ 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, \ 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, \ 0xae, 0xae, 0xae, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, \ 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, \ 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, \ 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, \ 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, \ 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xac, 0xac, 0xac, 0xac, 0xac, \ 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, \ 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, \ 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, \ 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, \ 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xab, \ 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, \ 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, \ 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, \ 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, \ 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, \ 0xab, 0xab, 0xab, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, \ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, \ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, \ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, \ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, \ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, \ 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, \ 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, \ 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, \ 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, \ 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa8, \ 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, \ 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, \ 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, \ 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, \ 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, \ 0xa8, 0xa8, 0xa8, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, \ 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, \ 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, \ 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, \ 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, \ 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, \ 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, \ 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, \ 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, \ 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, \ 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa5, \ 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, \ 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, \ 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, \ 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, \ 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, \ 0xa5, 0xa5, 0xa5, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, \ 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, \ 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, \ 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, \ 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, \ 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, \ 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, \ 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, \ 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, \ 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, \ 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa2, \ 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, \ 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, \ 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, \ 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, \ 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, \ 0xa2, 0xa2, 0xa2, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, \ 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, \ 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, \ 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, \ 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, \ 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, \ 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, \ 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, \ 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, \ 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, \ 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0x9f, \ 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, \ 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, \ 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, \ 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, \ 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, \ 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, \ 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, \ 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, \ 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, \ 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, \ 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, \ 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, \ 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, \ 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, \ 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, \ 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, \ 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, \ 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, \ 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, \ 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, \ 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, \ 0x9e, 0x9e, 0x9e, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, \ 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, \ 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, \ 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, \ 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, \ 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, \ 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, \ 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, \ 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, \ 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, \ 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9c, \ 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, \ 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, \ 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, \ 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, \ 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, \ 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, \ 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, \ 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, \ 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, \ 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, \ 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, \ 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, \ 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, \ 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, \ 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, \ 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, \ 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, \ 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, \ 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, \ 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, \ 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, \ 0x9b, 0x9b, 0x9b, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, \ 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, \ 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, \ 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, \ 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, \ 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, \ 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, \ 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, \ 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, \ 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, \ 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x99, \ 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, \ 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, \ 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, \ 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, \ 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, \ 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, \ 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, \ 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, \ 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, \ 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, \ 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x98, 0x98, 0x98, 0x98, 0x98, \ 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, \ 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, \ 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, \ 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, \ 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, \ 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, \ 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, \ 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, \ 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, \ 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, \ 0x98, 0x98, 0x98, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, \ 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, \ 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, \ 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, \ 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, \ 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, \ 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, \ 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, \ 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, \ 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, \ 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x96, \ 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, \ 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, \ 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, \ 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, \ 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, \ 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, \ 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, \ 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, \ 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, \ 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, \ 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x95, 0x95, 0x95, 0x95, 0x95, \ 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, \ 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, \ 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, \ 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, \ 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, \ 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, \ 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, \ 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, \ 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, \ 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, \ 0x95, 0x95, 0x95, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, \ 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, \ 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, \ 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, \ 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, \ 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, \ 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, \ 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, \ 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, \ 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, \ 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x93, \ 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, \ 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, \ 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, \ 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, \ 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, \ 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, \ 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, \ 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, \ 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, \ 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, \ 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x92, 0x92, 0x92, 0x92, 0x92, \ 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, \ 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, \ 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, \ 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, \ 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, \ 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, \ 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, \ 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, \ 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, \ 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, \ 0x92, 0x92, 0x92, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, \ 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, \ 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, \ 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, \ 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, \ 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, \ 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, \ 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, \ 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, \ 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, \ 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x90, \ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, \ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, \ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, \ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, \ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, \ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, \ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, \ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, \ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, \ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, \ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, \ 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, \ 0x8e, 0x8e, 0x8e, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, \ 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, \ 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, \ 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, \ 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, \ 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, \ 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, \ 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, \ 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, \ 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, \ 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, \ 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, \ 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, \ 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, \ 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, \ 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, \ 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, \ 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, \ 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, \ 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, \ 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, \ 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, \ 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, \ 0x8b, 0x8b, 0x8b, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, \ 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, \ 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, \ 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, \ 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, \ 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, \ 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, \ 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, \ 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, \ 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, \ 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, \ 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, \ 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, \ 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, \ 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, \ 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, \ 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, \ 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, \ 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, \ 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, \ 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, \ 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x89, 0x89, 0x89, 0x89, 0x89, \ 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, \ 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, \ 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, \ 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, \ 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, \ 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, \ 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, \ 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, \ 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, \ 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, \ 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, \ 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, \ 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, \ 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, \ 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, \ 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, \ 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, \ 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, \ 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, \ 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, \ 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x88, \ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, \ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, \ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, \ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, \ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, \ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, \ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, \ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, \ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, \ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, \ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, \ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, \ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, \ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, \ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, \ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, \ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, \ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, \ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, \ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, \ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, \ 0x88, 0x88, 0x88, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, \ 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, \ 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, \ 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, \ 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, \ 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, \ 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, \ 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, \ 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, \ 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, \ 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, \ 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, \ 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, \ 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, \ 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, \ 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, \ 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, \ 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, \ 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, \ 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, \ 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, \ 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x86, 0x86, 0x86, 0x86, 0x86, \ 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, \ 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, \ 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, \ 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, \ 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, \ 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, \ 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, \ 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, \ 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, \ 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, \ 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, \ 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, \ 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, \ 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, \ 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, \ 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, \ 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, \ 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, \ 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, \ 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, \ 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x85, \ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, \ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, \ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, \ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, \ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, \ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, \ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, \ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, \ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, \ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, \ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, \ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, \ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, \ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, \ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, \ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, \ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, \ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, \ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, \ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, \ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, \ 0x85, 0x85, 0x85, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, \ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, \ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, \ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, \ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, \ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, \ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, \ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, \ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, \ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, \ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, \ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, \ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, \ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, \ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, \ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, \ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, \ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, \ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, \ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, \ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, \ 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x83, 0x83, 0x83, 0x83, 0x83, \ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, \ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, \ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, \ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, \ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, \ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, \ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, \ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, \ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, \ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, \ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, \ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, \ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, \ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, \ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, \ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, \ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, \ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, \ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, \ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, \ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x82, \ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, \ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, \ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, \ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, \ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, \ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, \ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, \ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, \ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, \ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, \ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, \ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, \ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, \ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, \ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, \ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, \ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, \ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, \ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, \ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, \ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, \ 0x82, 0x82, 0x82, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, \ 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, \ 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, \ 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, \ 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, \ 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, \ 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, \ 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, \ 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, \ 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, \ 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, \ 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, \ 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, \ 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, \ 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, \ 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, \ 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, \ 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, \ 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, \ 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, \ 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, \ 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, \ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00 fuse-utils-1.5.1/rzxtool.c0000664000175000017500000002563115253737163014544 0ustar00fredmfredm/* rzxtool.c: Simple modifications to RZX files Copyright (c) 2007-2015 Philip Kendall, Sergio Baldovi 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. Author contact information: E-mail: philip-fuse@shadowmagic.org.uk */ #include "config.h" #include #include #include #include #ifdef HAVE_LIB_GLIB #include #endif /* #ifdef HAVE_LIB_GLIB */ #include "libspectrum.h" #include "utils.h" #define PROGRAM_NAME "rzxtool" const char *progname; static libspectrum_creator *creator; typedef enum action_type_t { ACTION_DELETE_BLOCK, ACTION_EXTRACT_SNAP, ACTION_INSERT_SNAP, ACTION_FINALISE_RZX, } action_type_t; typedef struct action_t { action_type_t type; size_t where; char *filename; } action_t; typedef struct options_t { const char *rzxfile; const char *outfile; int uncompressed; } options_t; static libspectrum_rzx_iterator get_block( libspectrum_rzx *rzx, size_t where ) { libspectrum_rzx_iterator it; for( it = libspectrum_rzx_iterator_begin( rzx ); it && where; where--, it = libspectrum_rzx_iterator_next( it ) ) ; /* Do nothing */ return it; } static int delete_block( libspectrum_rzx *rzx, size_t where ) { libspectrum_rzx_iterator it; it = get_block( rzx, where ); if( !it ) { fprintf( stderr, "%s: not enough blocks in RZX file\n", progname ); return 1; } libspectrum_rzx_iterator_delete( rzx, it ); return 0; } static int write_snapshot( libspectrum_snap *snap, const char *filename, const libspectrum_creator *rzx_creator ) { unsigned char *buffer = NULL; size_t length = 0; int error, flags; libspectrum_id_t type; libspectrum_class_t class; if( !rzx_creator ) rzx_creator = creator; error = libspectrum_identify_file_with_class( &type, &class, filename, NULL, 0 ); if( error ) return error; if( class != LIBSPECTRUM_CLASS_SNAPSHOT || type == LIBSPECTRUM_ID_UNKNOWN ) type = LIBSPECTRUM_ID_SNAPSHOT_SZX; error = libspectrum_snap_write( &buffer, &length, &flags, snap, type, (libspectrum_creator *)rzx_creator, 0 ); if( error ) return error; error = write_file( filename, buffer, length ); if( error ) { free( buffer ); return error; } free( buffer ); return 0; } static int extract_snap( libspectrum_rzx *rzx, size_t where, const char *filename ) { libspectrum_rzx_iterator it; libspectrum_snap *snap; int e; it = get_block( rzx, where ); if( !it ) { fprintf( stderr, "%s: not enough blocks in RZX file\n", progname ); return 1; } snap = libspectrum_rzx_iterator_get_snap( it ); if( !snap ) { fprintf( stderr, "%s: not a snapshot block\n", progname ); return 1; } e = write_snapshot( snap, filename, libspectrum_rzx_creator( rzx ) ); if( e ) return e; return 0; } static libspectrum_snap* read_snap( const char *filename ) { libspectrum_file file; int error; libspectrum_snap *snap; if( read_file( filename, &file ) ) return NULL; snap = libspectrum_snap_alloc(); error = libspectrum_snap_read( snap, file.buffer, file.length, file.type, file.filename ); if( error ) { libspectrum_snap_free( snap ); snap = NULL; } libspectrum_file_clear( &file ); return snap; } static int insert_snap( libspectrum_rzx *rzx, size_t where, const char *filename ) { libspectrum_snap *snap; snap = read_snap( filename ); if( !snap ) { fprintf( stderr, "%s: couldn't read `%s'\n", progname, filename ); return 1; } libspectrum_rzx_insert_snap( rzx, snap, where ); return 0; } static void apply_action( void *data, void *user_data ) { const action_t *action = data; libspectrum_rzx *rzx = user_data; int where = action->where; switch( action->type ) { case ACTION_DELETE_BLOCK: delete_block( rzx, where ); break; case ACTION_EXTRACT_SNAP: extract_snap( rzx, where, action->filename ); break; case ACTION_INSERT_SNAP: insert_snap( rzx, where, action->filename ); break; case ACTION_FINALISE_RZX: libspectrum_rzx_finalise( rzx ); break; default: fprintf( stderr, "%s: unknown action type %d\n", progname, action->type ); } /* Really would like to handle errors */ } static int parse_argument( const char *argument, int *where, const char **filename ) { char *comma; char *buffer; buffer = strdup( argument ); if( !buffer ) { fprintf( stderr, "%s: out of memory at %s:%d\n", progname, __func__, __LINE__ ); return 1; } comma = strchr( buffer, ',' ); if( !comma ) { fprintf( stderr, "%s: no comma found in argument `%s'\n", progname, argument ); free( buffer ); return 1; } *comma = 0; *where = atoi( buffer ); *filename = &argument[ comma + 1 - buffer ]; free( buffer ); return 0; } static int add_action( GSList **actions, action_type_t type, const char *argument ) { int error, where; const char *filename; action_t *action; action = malloc( sizeof( *action ) ); if( !action ) { fprintf( stderr, "%s: out of memory at %s:%d\n", progname, __func__, __LINE__ ); return 1; } action->type = type; if( type == ACTION_DELETE_BLOCK ) { action->where = atoi( argument ); action->filename = NULL; } else if( type == ACTION_FINALISE_RZX ) { action->where = 0; action->filename = NULL; } else { error = parse_argument( argument, &where, &filename ); if( error ) return error; action->where = where; action->filename = strdup( filename ); if( !action->filename ) { fprintf( stderr, "%s: out of memory at %s:%d\n", progname, __func__, __LINE__ ); return 1; } } *actions = g_slist_append( *actions, action ); return 0; } static void show_version( void ) { printf( PROGRAM_NAME " (" PACKAGE ") " PACKAGE_VERSION "\n" "Copyright (c) 2007-2014 Philip Kendall\n" "License GPLv2+: GNU GPL version 2 or later " "\n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" ); } static void show_help( void ) { printf( "Usage: %s [OPTION]... []\n" "Modify Sinclair ZX Spectrum input recording files.\n" "\n" "Options:\n" " -d Delete block number.\n" " -e ,\n" " The snapshot in the specified block number will be written\n" " to the specified filename.\n" " -i ,\n" " The snapshot specified in filename will be added to the file\n" " at the position specified by block number.\n" " -f Finalise the RZX file, removing any interspersed snapshot.\n" " -u Write uncompressed data to the output RZX file.\n" " -h, --help Display this help and exit.\n" " -V, --version Output version information and exit.\n" "\n" "Report %s bugs to <%s>\n" "%s home page: <%s>\n" "For complete documentation, see the manual page of %s.\n", progname, PROGRAM_NAME, PACKAGE_BUGREPORT, PACKAGE_NAME, PACKAGE_URL, PROGRAM_NAME ); } static int parse_options( int argc, char **argv, GSList **actions, struct options_t *options ) { int c, error = 0; int output_needed = 0; options->uncompressed = 0; struct option long_options[] = { { "help", 0, NULL, 'h' }, { "version", 0, NULL, 'V' }, { 0, 0, 0, 0 } }; while( ( c = getopt_long( argc, argv, "d:e:i:ufhV", long_options, NULL ) ) != -1 ) { switch( c ) { case 'd': error = add_action( actions, ACTION_DELETE_BLOCK, optarg ); output_needed = 1; break; case 'e': error = add_action( actions, ACTION_EXTRACT_SNAP, optarg ); break; case 'i': error = add_action( actions, ACTION_INSERT_SNAP, optarg ); output_needed = 1; break; case 'f': error = add_action( actions, ACTION_FINALISE_RZX, optarg ); output_needed = 1; break; case 'u': options->uncompressed = 1; output_needed = 1; break; case 'h': show_help(); exit( 0 ); case 'V': show_version(); exit( 0 ); case '?': /* getopt prints an error message to stderr */ error = 1; break; default: error = 1; fprintf( stderr, "%s: unknown option `%c'\n", progname, (char) c ); break; } if( error ) break; } if( error ) return error; if( !argv[ optind ] ) { fprintf( stderr, "%s: no RZX file specified\n", progname ); return 1; } options->rzxfile = argv[ optind++ ]; if( output_needed ) { if( !argv[ optind ] ) { fprintf( stderr, "%s: no RZX output file specified\n", progname ); return 1; } options->outfile = argv[ optind++ ]; } else { options->outfile = NULL; } if( argv[ optind ] ) { fprintf( stderr, "%s: extra argument on command line\n", progname ); return 1; } return 0; } static int write_rzx( const char *filename, libspectrum_rzx *rzx, int compressed ) { unsigned char *buffer = NULL; size_t length = 0; int error; error = libspectrum_rzx_write( &buffer, &length, rzx, LIBSPECTRUM_ID_UNKNOWN, creator, compressed, NULL ); if( error ) return error; error = write_file( filename, buffer, length ); if( error ) { free( buffer ); return error; } free( buffer ); return 0; } int main( int argc, char *argv[] ) { GSList *actions = NULL; options_t options; libspectrum_file file; libspectrum_rzx *rzx; int error; progname = argv[0]; error = init_libspectrum(); if( error ) return error; error = get_creator( &creator, "rzxtool" ); if( error ) return error; error = parse_options( argc, argv, &actions, &options ); if( error ) { fprintf( stderr, "Try `%s --help' for more information.\n", progname ); return error; } error = read_file( options.rzxfile, &file ); if( error ) return error; rzx = libspectrum_rzx_alloc(); error = libspectrum_rzx_read( rzx, file.buffer, file.length ); libspectrum_file_clear( &file ); if( error ) return error; g_slist_foreach( actions, apply_action, rzx ); if( options.outfile ) { error = write_rzx( options.outfile, rzx, !options.uncompressed ); if( error ) return error; } return 0; } fuse-utils-1.5.1/ChangeLog0000664000175000017500000004640515267623700014427 0ustar00fredmfredm2026-10-17 Fredrick Meunier * Version 1.5.1 released * audio2tape * Document PZX and CSW output support and format limitations (thanks, Sergio Baldoví) (Fredrick Meunier). * tapeconv * Document PZX and CSW output support and format limitations (thanks, Sergio Baldoví) (Fredrick Meunier). * Improve conversion error messages and warn when PZX output omits screen or inlay attachments (Fredrick Meunier). * tzxlist * Show TZX CSW recording details (bug #528) (thanks, AJ B) (Fredrick Meunier). * Read TZX metadata as UTF-8 from libspectrum when converting to the current locale's character encoding (Fredrick Meunier). * General * Add automated utility tests and run them in Linux and macOS CI builds (Fredrick Meunier). * Cache libspectrum builds and cancel superseded CI builds (Fredrick Meunier). * Remove the obsolete Autotools ranlib check (Sergio Baldoví). * Fix compiler warnings (Fredrick Meunier). 2026-09-20 Fredrick Meunier * Version 1.5.0 released * listbasic * Support extracting BASIC listings from Microdrive cartridge images (Fredrick Meunier). * mdrlist * New utility to list the contents of an MDR Microdrive cartridge image (Fredrick Meunier). * fmfconv * Refresh flashing cells when the FMF flash phase changes (bug #526) (thanks, Alberto Garcia) (Fredrick Meunier). * rzxdump * Display the contents of compressed input blocks (Fredrick Meunier). * rzxtool * Retain RZX creator metadata when extracting snapshots (Fredrick Meunier). * snapdump * Display descriptive joystick connection information (Fredrick Meunier). * General * Require C11 compiler support (Fredrick Meunier). * Use libspectrum's file-loading abstraction across utilities (bugs #507 and #192) (thanks, Gergely Szasz and Bernat) (Fredrick Meunier). * Adapt tape utilities to the latest libspectrum APIs (Fredrick Meunier). 2026-08-24 Fredrick Meunier * Version 1.4.7 released * audio2tape * Fix terminal ROM block decoding, including missing final checksum bits and pulse timings (bug #520) (thanks, AJ B.) (Fredrick Meunier). * Discard empty decoded and raw tape blocks safely (Fredrick Meunier). * Reduce the size of preserved audio and avoid invalid TZX output for preserved sections longer than 38 seconds (bug #521) (AJ B.). * Preserve recorded pause durations instead of writing every pause as 1 ms (bug #522) (AJ B.). * Preserve checksum-failing decoded blocks as raw audio when using -k (bug #523) (AJ B.). * Preserve all-zero decoded blocks as raw audio when using -k (bug #524) (AJ B.). * raw2hdf * Fix formatting of the rawfile and --version options in the man page (Alberto Garcia). * tape2wav * Reject zero sample rates (Fredrick Meunier). * Terminate WAV output correctly after zero-pause tape blocks (Fredrick Meunier). * General * Improve Windows distribution dependency handling and include its DLL dependency checking script (Sergio Baldoví). 2026-07-25 Fredrick Meunier * Version 1.4.6 released * tzxlist * Decode BASIC tokens and symbols in tape header names (Fredrick Meunier). * fmfconv * Fix a discarded const qualifier compiler warning (Sergio Baldoví). * scl2trd * Avoid a potential output truncation compiler warning (Sergio Baldoví). * General * Improve Windows distribution builds and DLL dependency handling (Sergio Baldoví). * Use libspectrum allocation for creator custom data (Sergio Baldoví). 2026-05-05 Fredrick Meunier * Version 1.4.5 released * tape2wav * Allow writing WAV files without libaudiofile (thanks, Andre Leiradella) (Fredrick Meunier). 2026-03-22 Philip Kendall * Version 1.4.4 released * snapdump * Add uSpeech block (Sergio Baldoví). * tzxlist * Consider loop blocks to calculate tape duration (Luis Faria; thanks, Martin Garton). * Fix description of TZX message blocks (Alberto Garcia). * rzxcheck * Remove double-free bug (Sergio Baldoví). 2018-07-01 Philip Kendall * Version 1.4.3 released * audio2tape * Replace deprecated auto_ptr with unique_ptr (Sergio Baldoví). * createhdf * Cast size_t variables to unsigned long in printf() statements (Sergio Baldoví). * fmfconv * Fix printf() conversion specifiers (Sergio Baldoví). * Fix ULAW identification (Sergio Baldoví). * Force pad byte to value zero in WAV files (Sergio Baldoví). * rzxdump * Cast size_t variables to unsigned long in printf() statements (Sergio Baldoví). * Fix printf() conversion specifiers (Sergio Baldoví). * snapdump * Cast size_t variables to unsigned long in printf() statements (Sergio Baldoví). * Fix printf() conversion specifiers (Sergio Baldoví). * tape2pulses * Close file on error (Sergio Baldoví). * tzxlist * Fix printf() conversion specifiers (Sergio Baldoví). 2018-06-03 Philip Kendall * Version 1.4.2 released * listbasic * Fix processing tape files (thanks, Stuart Caie) (Fredrick Meunier). * fmfconv * Fix undefined behaviour when writing AVI files (Sergio Baldoví). * Don't change audio layout in lossless encode examples in manual (Sergio Baldoví). * rzxdump * Fix crash when extracting compressed snapshots (Sergio Baldoví). 2018-04-29 Philip Kendall * Version 1.4.1 released * snapdump * Don't print UTF-8 characters to the terminal (Sergio Baldoví). * snap2tzx * Add 4500 and 5000 bps rates for use with TZXduino (Duncan Edwards). * Various minor bug fixes/improvements: * Add more examples of fmfconv movie conversion (thanks, lister_of_smeg) (Sergio Baldoví). * Minor code changes in fmfconv (Fredrick Meunier). 2017-12-10 Philip Kendall * Version 1.4.0 released * snapdump * New utility to dump information about machine status stored in a snapshot file (Sergio Baldoví). 2017-10-10 Philip Kendall * Version 1.3.5 released * fmfconv * Fix build in big-endian platforms (Alberto Garcia). * Remove unimplemented SCR reading (Fredrick Meunier). * Various minor bug fixes/improvements: * Fix GLib replacement detection (Sergio Baldoví). * Fix libspectrum.h preprocessing in windres resources (Guesser). 2017-09-03 Philip Kendall * Version 1.3.4 released * fmfconv * Fix handling of Timex hires frames (Fredrick Meunier). * Extract FMF type handling (Fredrick Meunier). * tzxlist * Extend header info (Chris Born). 2017-07-31 Philip Kendall * Version 1.3.3 released * fmfconv * Move fmfconv output routines to a directory (Fredrick Meunier). * Extract compressed block reading routines (Fredrick Meunier). * Various minor bug fixes/improvements: * Check required version of libspectrum is available (bug #382) (Sergio Baldoví and Fredrick Meunier). 2017-07-02 Philip Kendall * Version 1.3.2 released * rzxdump * Allow extracting snapshot files (Sergio Baldoví). * scl2trd * Print error messages to stderr (Sergio Baldoví). * Various minor bug fixes/improvements: * Ignore .DS_Store files too (Fredrick Meunier). * Check close()/fclose() return value on write operations (Sergio Baldoví). * Move write_file() into utils.c and share between utilities (Sergio Baldoví). * Also ignore *~ files (Fredrick Meunier). * Switch to using autoreconf (Fredrick Meunier). * Use silent builds by default (Fredrick Meunier). 2016-11-05 Philip Kendall * Version 1.3.1 released * Fix metadata in AVI files and standardise in other formats (Sergio Baldoví). * fmfconv * Return proper exit codes from utility (Sergio Baldoví). 2016-10-02 Philip Kendall * Version 1.3.0 released * Print summary of enabled features when building fuse-utils (Alberto Garcia). * rzxdump * Print offset of unknown block types (Sergio Baldoví). * Print the canonical version of the creator based on major/minor versions (Sergio Baldoví). 2016-08-21 Philip Kendall * Version 1.2.2 released * scl2trd * Fix buffer over-read (Sergio Baldoví). * tape2pulses * tape2wav * Emit an edge when 0 tstate pulses do not have the no edge flag set (Fredrick Meunier). 2016-06-06 Philip Kendall * Version 1.2.0 released * fmfconv * Drop FFmpeg/Libav API support in fmfconv (Sergio Baldoví). * Support JPEG, PNG and AVI output formats (Gergely Szasz). * Set default output type to AVI instead of YUV4MPEG2 when using pipes (Gergely Szasz). * Move --force-resample and --srate options (Gergely Szasz). * Add more details on DESCRIPTION, EXAMPLES and SEE ALSO (Sergio Baldoví). * Add missing options and arrange options in categories (Sergio Baldoví). * Set output mode to AVI when using .avi file extension (Sergio Baldoví). * Ensure AVI files are finalised and delete the index file on Windows (Sergio Baldoví). * Allow greyscale output (Gergely Szasz). * Implement --version option in fmfconv (Gergely Szasz). * Fix crash when writing a sequence of screenshots (Sergio Baldoví). * New internal sound resampling (Gergely Szasz). * rzxtool: * Fix snapshot insertion in rzx recordings (Sergio Baldoví). * Add option for finalising rzx recordings (Sergio Baldoví). * tzxlist * Dump headers that appear to be in data blocks (Fredrick Meunier). * Dump standard data blocks to files (Gergely Szasz). * Don't print non-printable header characters like Fuse (Fredrick Meunier). * Allow tape durations longer than 20.5 minutes (UB880D). * tape2pulses * New utility to dump the pulses found in a tape file to a file for analysis (Fredrick Meunier). * tape2wav * Correct default WAV sample rate (Santiago Vila). * rzxdump: * Show block number as is needed for some operations with rzxtool (Sergio Baldoví). * Fix exit code when passed bad operands (Sergio Baldoví). * Fix leaks and possible null pointer dereferences (Sergio Baldoví). * scl2trd * Fix exit code when passed bad operands (Sergio Baldoví). * audio2tape * Use char* for progname for consistency with utils.c (Fredrick Meunier). * Declare C linkage for progname (Adam Sampson). * Various minor bug fixes/improvements: * Update iconv to version from gettext-0.18.2 (Fredrick Meunier). * Select glibtoolize where required (Sergio Baldoví). * Ensure definitions of AC_LIB_PREPARE_PREFIX, AC_LIB_RPATH, AC_LIB_LINKFLAGS_BODY and AC_LIB_APPENDTOVAR are always available (Fredrick Meunier). * Win32: prefer groff to man2html (Sergio Baldoví). * Abort program when passed unknown options (Sergio Baldoví). * Add --version option to the utilities (Sergio Baldoví). * Add version info to Windows executables (Sergio Baldoví). * Add --help option to the utilities (Sergio Baldoví). * Add pkg.m4 for PKG_CHECK_MODULES in case the platform doesn't have pkg-config installed (Sergio Baldoví). * C89 compilation fixes (Adrien Destugues). * Add static to functions where appropriate (Stuart Brady). * Take Windows distribution rules out of main Makefile.am (Sergio Baldoví). * Modernise autoconf support (Sergio Baldoví). * Check for libspectrum's own GLib replacement (Stuart Brady and Sergio Baldoví). 2013-05-24 Philip Kendall * Version 1.1.1 released * Fix typo in header search path for local libraries (Alberto Garcia). * Fix syntax error in fmfconv manual page (Alberto Garcia). 2013-05-18 Philip Kendall * Version 1.1.0 released * fmfconv * New converter tool for FMF movie files (Gergely Szasz). * tape2wav * Allow writing WAV output to stdout (Fredrick Meunier and Sergio Baldovi). * Respect polarity when writing audio data (Fredrick Meunier). * tzxlist * Add support for PZX files (Fredrick Meunier). * Add support for TZX set signal level block (Fredrick Meunier). * Print CODE header start address and length (Fredrick Meunier). * tapeconv * Correct check for unknown file types (Michael Tautschnig). 2010-12-16 Philip Kendall * Version 1.0.0 released * audio2tape * work with stereo sound files (Fredrick Meunier; thanks, Gilberto Almeida). * don't crash on an empty ROM block (Fredrick Meunier). * tzxlist * print data from ROM header blocks (Fredrick Meunier). * Assume non-ASCII characters are in Windows-1252 (Fredrick Meunier). * snapconv: add -f flag to fix .szx files written with old versions of libspectrum (Fredrick Meunier). * raw2hdf: ensure version data is always written (Fredrick Meunier; thanks, UB880D). 2008-12-10 Philip Kendall * Version 0.10.0.1 released * Ensure all audio2tape header files are distributed (Fredrick Meunier). * Fix compilation when libaudiofile isn't present (Fredrick Meunier). 2008-12-03 Philip Kendall * Version 0.10.0 released * audio2tape can now recognise standard ROM loaders (Fredrick Meunier). * tzxlist now outputs block and tape lengths (Fredrick Meunier). * snap2tzx: add 0.1s pause between blocks to ensure a gap between edges (Fredrick Meunier). * tapeconv: add options for embedding metadata into the created file (Fredrick Meunier). * tape2wav: ensure pulses do not get rounded down inappropriately (Fredrick Meunier). * Allow building without libaudiofile (José Manuel Ferrer Ortiz). 2008-01-05 Philip Kendall * Version 0.9.0 released * Add audio2tape and tape2wav utilities to convert between audio and tape formats (Fredrick Meunier). * Remove use of mmap() (Philip Kendall). * Beta BASIC support for listbasic (Stuart Brady). * Win32 fixes (Stuart Brady). * Man page fixes (Stuart Brady). 2007-05-11 Philip Kendall * Version 0.8.0.1 released (bug fix release) * Distribute ide.h (thanks, Alberto Garcia) (Fredrick Meunier). * Distribute the hacking/ directory (thanks, Stuart Brady) (Philip Kendall). * Update the pointers to the HDF specification to point to v1.1 (Stuart Brady). 2007-04-11 Philip Kendall * Version 0.8.0 released * Add raw2hdf utility for creating HDF hard disk images from other data (Matthew Westcott). * Allow tzxlist to handle all tape types supported by libspectrum (Fredrick Meunier). * Allow tzxlist to support the TZX generalised data block (Philip Kendall). * Add -c and -n options to snapconv allowing for writing of always compressed and never compressed snapshots (Philip Kendall). 2004-07-16 Philip Kendall * Version 0.7.0 released. * Add createhdf utility for creating empty .hdf IDE hard disk images (Philip Kendall). 2004-02-11 Philip Kendall * Version 0.6.2 released. * Add some small bits of system information (OS, libspectrum version) into creator custom data for formats which support this (Philip Kendall). * QNX6 compilation fixes and package file (Mike Gorchak). * rzxcheck: return 1 if the RZX file does not have a good signature (Philip Kendall). * rzxdump: use libgcrypt 1.1.42 or later (Philip Kendall). * snap2tzx: new utility to convert snapshots to tape files. Heavily based on Tomaz Kac's 'z802tzx' (Philip Kendall). * tapeconv, tzxlist: remove double-free bug if tape reading fails (Philip Kendall). 2003-09-13 Philip Kendall * Version 0.6.1 released * Add `snapconv' utility to convert between snapshot formats (Philip Kendall). * Add `rzxcheck' utility to verify the digital signature in an RZX file (Philip Kendall). * listbasic: a line number of >= 16384 implies the end of BASIC, not just > 16384 (Darren Salt). * listbasic: formatting improvements and support for 128K and TC2068 keywords (Darren Salt). * listbasic: add man page (Philip Kendall). * Various improvements due to libspectrum changes: notably support for Warajevo .tap files and many more snapshot formats. 2003-04-27 Philip Kendall * Version 0.6.0 released. * Add functionality to `tzxconv' to read and write both .tzx and .tap; hence rename it to `tapeconv'. * Stop `rzxtool' accessing unallocated memory when adding a snapshot to an RZX file. * Add `scl2trd' utility to convert .scl files to .trd files (Fredrick Meunier). * Add `listbasic' utility to extract the BASIC listing from a snapshot or tape file. Heavily based on Chris Cowley's SnapList, http://freestuff.grok.co.uk/snaplist/index.html (Philip Kendall). 2002-12-09 Philip Kendall * Version 0.5.1 released. * Split the utilities from Fuse itself. * Add `tzxconv' utility to do a best-guess conversion of .tzx files to .tap files. fuse-utils-1.5.1/tape2pulses_res.rc0000664000175000017500000000366215157611610016314 0ustar00fredmfredm/* tape2pulses_res.rc: resources for Windows executable Copyright (c) 2016 Sergio Baldovi 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. Author contact information: E-mail: serbalgi@gmail.com */ #include "config.h" #include /* VERSIONINFO specs: http://msdn.microsoft.com/en-us/library/aa381058%28VS.85%29.aspx */ VS_VERSION_INFO VERSIONINFO FILEVERSION FUSE_UTILS_RC_VERSION PRODUCTVERSION FUSE_UTILS_RC_VERSION FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0x0L FILEOS VOS__WINDOWS32 FILETYPE VFT_APP FILESUBTYPE VFT2_UNKNOWN BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904B0" BEGIN VALUE "CompanyName", "\0" VALUE "FileDescription", "Dump pulses from ZX Spectrum tape to text file\0" VALUE "FileVersion", VERSION##"\0" VALUE "InternalName", "tape2pulses\0" VALUE "LegalCopyright", "Copyright (c) 2016 Fredrick Meunier\0" VALUE "License", "tape2pulses is licensed under the GNU General Public License, version 2 or later\0" VALUE "OriginalFilename", "tape2pulses.exe\0" VALUE "ProductName", PACKAGE##"\0" VALUE "ProductVersion", VERSION##"\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1252 END END fuse-utils-1.5.1/createhdf.c0000664000175000017500000002050415157611610014731 0ustar00fredmfredm/* createhdf.c: Create an empty .hdf file Copyright (c) 2004-2006 Philip Kendall Copyright (c) 2015 Sergio Baldovi 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. Author contact information: Philip Kendall */ #include "config.h" #include #include #include #include #include #include #include #include #include "compat.h" #include "ide.h" #define PROGRAM_NAME "createhdf" const char *progname; #define CHUNK_LENGTH 1 << 20 static void show_version( void ) { printf( PROGRAM_NAME " (" PACKAGE ") " PACKAGE_VERSION "\n" "Copyright (c) 2004-2006 Philip Kendall\n" "License GPLv2+: GNU GPL version 2 or later " "\n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" ); } static void show_help( void ) { printf( "Usage: %s [OPTION]... \n" "Creates a blank image of an IDE hard disk in .hdf format.\n" "\n" "Options:\n" " -c Create .hdf image in compact mode, where only the low byte\n" " of every word is stored in the image.\n" " -s Do not create .hdf image as a sparse file, i.e., empty\n" " space synthesised by the operating system.\n" " -v Specifies the version of .hdf image to be created (values\n" " 1.0 or 1.1). Defaults to creating version 1.1 files.\n" " -h, --help Display this help and exit.\n" " -V, --version Output version information and exit.\n" "\n" "Non-option arguments:\n" " cylinders Specifies the number of cylinders in the image.\n" " heads Specifies the number of heads in the image.\n" " sectors Specifies the number of sectors in the image.\n" " file Specifies the file to which the image should be written.\n" "\n" "Report %s bugs to <%s>\n" "%s home page: <%s>\n" "For complete documentation, see the manual page of %s.\n", progname, PROGRAM_NAME, PACKAGE_BUGREPORT, PACKAGE_NAME, PACKAGE_URL, PROGRAM_NAME ); } static int parse_options( int argc, char **argv, size_t *cylinders, size_t *heads, size_t *sectors, int *compact, int *sparse, const char **filename, enum hdf_version_t *version ) { int c; int error = 0; struct option long_options[] = { { "help", 0, NULL, 'h' }, { "version", 0, NULL, 'V' }, { 0, 0, 0, 0 } }; while( ( c = getopt_long( argc, argv, "csv:hV", long_options, NULL ) ) != -1 ) { switch( c ) { case 'c': *compact = 1; break; case 's': *sparse = 0; break; case 'v': if( strcasecmp( optarg, "1.0" ) == 0 ) { *version = HDF_VERSION_10; } else if( strcasecmp( optarg, "1.1" ) == 0 ) { *version = HDF_VERSION_11; } else { error = 1; fprintf( stderr, "%s: version not supported\n", progname ); } break; case 'h': show_help(); exit( 0 ); case 'V': show_version(); exit( 0 ); case '?': /* getopt prints an error message to stderr */ error = 1; break; default: error = 1; fprintf( stderr, "%s: unknown option `%c'\n", progname, (char) c ); break; } } if( error ) return error; if( argc - optind != 4 ) { fprintf( stderr, "%s: usage: %s [-c] [-s] [-v] \n", progname, progname ); return 1; } *cylinders = atoi( argv[ optind++ ] ); *heads = atoi( argv[ optind++ ] ); *sectors = atoi( argv[ optind++ ] ); *filename = argv[ optind++ ]; return 0; } static int write_header( int fd, size_t cylinders, size_t heads, size_t sectors, int compact, const char *filename, enum hdf_version_t version ) { char *hdf_header, *identity; size_t bytes, data_offset; data_offset = hdf_data_offset( version ); hdf_header = calloc( 1, data_offset ); if( !hdf_header ) { fprintf( stderr, "%s: out of memory at line %d\n", progname, __LINE__ ); return 1; } memcpy( &hdf_header[ HDF_SIGNATURE_OFFSET ], HDF_SIGNATURE, HDF_SIGNATURE_LENGTH ); hdf_header[ HDF_VERSION_OFFSET ] = hdf_version( version ); hdf_header[ HDF_COMPACT_OFFSET ] = compact; hdf_header[ HDF_DATA_OFFSET_OFFSET ] = ( data_offset ) & 0xff; hdf_header[ HDF_DATA_OFFSET_OFFSET + 1 ] = ( data_offset >> 8 ) & 0xff; identity = &hdf_header[ HDF_IDENTITY_OFFSET ]; identity[ IDENTITY_CYLINDERS_OFFSET ] = ( cylinders ) & 0xff; identity[ IDENTITY_CYLINDERS_OFFSET + 1 ] = ( cylinders >> 8 ) & 0xff; identity[ IDENTITY_HEADS_OFFSET ] = ( heads ) & 0xff; identity[ IDENTITY_HEADS_OFFSET + 1 ] = ( heads >> 8 ) & 0xff; identity[ IDENTITY_SECTORS_OFFSET ] = ( sectors ) & 0xff; identity[ IDENTITY_SECTORS_OFFSET + 1 ] = ( sectors >> 8 ) & 0xff; bytes = write( fd, hdf_header, data_offset ); if( bytes != data_offset ) { fprintf( stderr, "%s: could write only %lu header bytes out of %lu to '%s'\n", progname, (unsigned long)bytes, (unsigned long)data_offset, filename ); free( hdf_header ); return 1; } free( hdf_header ); return 0; } static int write_data( int fd, size_t cylinders, size_t heads, size_t sectors, int compact, int sparse, const char *filename, enum hdf_version_t version ) { size_t data_size; data_size = cylinders * heads * sectors * ( compact ? 0x100 : 0x200 ); if( sparse ) { if( ftruncate( fd, data_size + hdf_data_offset( version ) ) ) { fprintf( stderr, "%s: error truncating '%s': %s\n", progname, filename, strerror( errno ) ); return 1; } } else { char buffer[ CHUNK_LENGTH ]; size_t total_written; memset( buffer, 0, CHUNK_LENGTH ); total_written = 0; while( data_size ) { size_t bytes_to_write, bytes_written; bytes_to_write = data_size > CHUNK_LENGTH ? CHUNK_LENGTH : data_size; bytes_written = write( fd, buffer, bytes_to_write ); if( bytes_written != bytes_to_write ) { fprintf( stderr, "%s: could write only %lu bytes out of %lu to '%s'", progname, (unsigned long)( total_written + bytes_written ), (unsigned long)data_size, filename ); return 1; } total_written += bytes_to_write; data_size -= bytes_to_write; } } return 0; } int main( int argc, char **argv ) { size_t cylinders, heads, sectors; int compact, sparse; enum hdf_version_t version; const char *filename; int fd; int error; progname = argv[0]; compact = 0; sparse = 1; version = HDF_VERSION_11; error = parse_options( argc, argv, &cylinders, &heads, §ors, &compact, &sparse, &filename, &version ); if( error ) { fprintf( stderr, "Try `%s --help' for more information.\n", progname ); return error; } fd = open( filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH ); if( fd == -1 ) { fprintf( stderr, "%s: error opening '%s': %s\n", progname, filename, strerror( errno ) ); return 1; } error = write_header( fd, cylinders, heads, sectors, compact, filename, version ); if( error ) { close( fd ); return error; } error = write_data( fd, cylinders, heads, sectors, compact, sparse, filename, version ); if( error ) { close( fd ); return error; } if( close( fd ) ) { fprintf( stderr, "%s: error closing `%s': %s\n", progname, filename, strerror( errno ) ); return 1; } return 0; } fuse-utils-1.5.1/mdrlist_res.rc0000664000175000017500000000363715253737163015536 0ustar00fredmfredm/* mdrlist_res.rc: resources for Windows executable Copyright (c) 2015 Sergio Baldovi 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. Author contact information: E-mail: serbalgi@gmail.com */ #include "config.h" #include /* VERSIONINFO specs: http://msdn.microsoft.com/en-us/library/aa381058%28VS.85%29.aspx */ VS_VERSION_INFO VERSIONINFO FILEVERSION FUSE_UTILS_RC_VERSION PRODUCTVERSION FUSE_UTILS_RC_VERSION FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0x0L FILEOS VOS__WINDOWS32 FILETYPE VFT_APP FILESUBTYPE VFT2_UNKNOWN BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904B0" BEGIN VALUE "CompanyName", "\0" VALUE "FileDescription", "Sinclair ZX Spectrum Microdrive file lister\0" VALUE "FileVersion", VERSION##"\0" VALUE "InternalName", "mdrlist\0" VALUE "LegalCopyright", "Copyright (c) 2026 Fredrick Meunier\0" VALUE "License", "mdrlist is licensed under the GNU General Public License, version 2 or later\0" VALUE "OriginalFilename", "mdrlist.exe\0" VALUE "ProductName", PACKAGE##"\0" VALUE "ProductVersion", VERSION##"\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1252 END END fuse-utils-1.5.1/snapconv.c0000664000175000017500000001366715253737163014660 0ustar00fredmfredm/* snapconv.c: Convert snapshot formats Copyright (c) 2003-2005 Philip Kendall Copyright (c) 2014-2015 Sergio Baldovi 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. Author contact information: E-mail: philip-fuse@shadowmagic.org.uk */ #include "config.h" #include #include #include #include #include #include #include "libspectrum.h" #include "compat.h" #include "utils.h" #define PROGRAM_NAME "snapconv" char *progname; static void fix_snapshot( libspectrum_snap *snap ) { libspectrum_byte a = libspectrum_snap_a( snap ); libspectrum_byte f = libspectrum_snap_f( snap ); libspectrum_snap_set_a( snap, f ); libspectrum_snap_set_f( snap, a ); a = libspectrum_snap_a_( snap ); f = libspectrum_snap_f_( snap ); libspectrum_snap_set_a_( snap, f ); libspectrum_snap_set_f_( snap, a ); } static void show_version( void ) { printf( PROGRAM_NAME " (" PACKAGE ") " PACKAGE_VERSION "\n" "Copyright (c) 2003-2005 Philip Kendall\n" "License GPLv2+: GNU GPL version 2 or later " "\n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" ); } static void show_help( void ) { printf( "Usage: %s [OPTION]... \n" "Sinclair ZX Spectrum snapshot converter.\n" "\n" "Options:\n" " -c Force all data in the output snapshot to be compressed.\n" " -n Store uncompressed data in the output snapshot.\n" " -f Swap the A and F and A' and F' registers. Fix buggy snapshots\n" " created by an old libspectrum version.\n" " -h, --help Display this help and exit.\n" " -V, --version Output version information and exit.\n" "\n" "Report %s bugs to <%s>\n" "%s home page: <%s>\n" "For complete documentation, see the manual page of %s.\n", progname, PROGRAM_NAME, PACKAGE_BUGREPORT, PACKAGE_NAME, PACKAGE_URL, PROGRAM_NAME ); } int main( int argc, char **argv ) { libspectrum_snap *snap; libspectrum_id_t type; libspectrum_class_t class; libspectrum_file file; unsigned char *buffer; size_t length; libspectrum_creator *creator; int flags; int compress = 0; int fix = 0; int error = 0; int c; struct option long_options[] = { { "help", 0, NULL, 'h' }, { "version", 0, NULL, 'V' }, { 0, 0, 0, 0 } }; progname = argv[0]; while( ( c = getopt_long( argc, argv, "cnfhV", long_options, NULL ) ) != -1 ) { switch( c ) { case 'c': compress = LIBSPECTRUM_FLAG_SNAPSHOT_ALWAYS_COMPRESS; break; case 'n': compress = LIBSPECTRUM_FLAG_SNAPSHOT_NO_COMPRESSION; break; case 'f': fix = 1; break; case 'h': show_help(); return 0; case 'V': show_version(); return 0; case '?': /* getopt prints an error message to stderr */ error = 1; break; default: error = 1; fprintf( stderr, "%s: unknown option `%c'\n", progname, (char) c ); break; } } argc -= optind; argv += optind; if( error ) { fprintf( stderr, "Try `%s --help' for more information.\n", progname ); return error; } if( argc < 2 ) { fprintf( stderr, "%s: usage: %s [-c] [-n] [-f] \n", progname, progname ); fprintf( stderr, "Try `%s --help' for more information.\n", progname ); return 1; } error = init_libspectrum(); if( error ) return error; snap = libspectrum_snap_alloc(); if( read_file( argv[0], &file ) ) { libspectrum_snap_free( snap ); return 1; } error = libspectrum_snap_read( snap, file.buffer, file.length, file.type, file.filename ); if( error ) { libspectrum_snap_free( snap ); libspectrum_file_clear( &file ); return error; } libspectrum_file_clear( &file ); if( fix ) fix_snapshot( snap ); error = libspectrum_identify_file_with_class( &type, &class, argv[1], NULL, 0 ); if( error ) { libspectrum_snap_free( snap ); return error; } if( class != LIBSPECTRUM_CLASS_SNAPSHOT ) { fprintf( stderr, "%s: '%s' is not a snapshot file\n", progname, argv[1] ); libspectrum_snap_free( snap ); return 1; } error = get_creator( &creator, "snapconv" ); if( error ) { libspectrum_snap_free( snap ); return error; } length = 0; error = libspectrum_snap_write( &buffer, &length, &flags, snap, type, creator, compress ); if( error ) { libspectrum_creator_free( creator ); libspectrum_snap_free( snap ); return error; } if( flags & LIBSPECTRUM_FLAG_SNAPSHOT_MAJOR_INFO_LOSS ) { fprintf( stderr, "%s: warning: major information loss during conversion\n", progname ); } else if( flags & LIBSPECTRUM_FLAG_SNAPSHOT_MINOR_INFO_LOSS ) { fprintf( stderr, "%s: warning: minor information loss during conversion\n", progname ); } error = libspectrum_creator_free( creator ); if( error ) { free( buffer ); libspectrum_snap_free( snap ); return error; } error = libspectrum_snap_free( snap ); if( error ) { free( buffer ); return error; } error = write_file( argv[1], buffer, length ); if( error ) { free( buffer ); return error; } free( buffer ); return 0; } fuse-utils-1.5.1/profile2map_res.rc0000664000175000017500000000363615157611610016266 0ustar00fredmfredm/* profile2map_res.rc: resources for Windows executable Copyright (c) 2015 Sergio Baldovi 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. Author contact information: E-mail: serbalgi@gmail.com */ #include "config.h" #include /* VERSIONINFO specs: http://msdn.microsoft.com/en-us/library/aa381058%28VS.85%29.aspx */ VS_VERSION_INFO VERSIONINFO FILEVERSION FUSE_UTILS_RC_VERSION PRODUCTVERSION FUSE_UTILS_RC_VERSION FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0x0L FILEOS VOS__WINDOWS32 FILETYPE VFT_APP FILESUBTYPE VFT2_UNKNOWN BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904B0" BEGIN VALUE "CompanyName", "\0" VALUE "FileDescription", "Fuse profiler output converter\0" VALUE "FileVersion", VERSION##"\0" VALUE "InternalName", "profile2map\0" VALUE "LegalCopyright", "Copyright (c) 2007 Stuart Brady\0" VALUE "License", "profile2map is licensed under the GNU General Public License, version 2 or later\0" VALUE "OriginalFilename", "profile2map.exe\0" VALUE "ProductName", PACKAGE##"\0" VALUE "ProductVersion", VERSION##"\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1252 END END fuse-utils-1.5.1/COPYING0000664000175000017500000004310315157611610013673 0ustar00fredmfredm 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. fuse-utils-1.5.1/fmfconv_types.h0000664000175000017500000000350415157611610015674 0ustar00fredmfredm/* fmfconv_types.h: .fmf movie file types Copyright (c) 2017 Fredrick Meunier 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. Author contact information: E-mail: fredm@spamcop.net */ #ifndef FMFCONV_TYPES_H #define FMFCONV_TYPES_H #include #include "libspectrum.h" typedef enum { STANDARD, /* screen type $ -> normal Spectrum */ HIRES, /* R -> Timex HighRes */ HICOLOR, /* C -> Timex HiColor */ STANDARD_TIMEX /* X -> Timex normal */ } fmf_screen_type; fmf_screen_type get_screen_type( libspectrum_byte screen_type ); typedef enum { PCM, ALW, ULW } fmf_sound_type; fmf_sound_type get_sound_type( int sound_type ); const char* get_sound_type_string( fmf_sound_type sound_type ); typedef enum { STEREO, MONO } fmf_sound_channels_type; fmf_sound_channels_type get_sound_channels_type( int sound_channels_type ); int get_sound_channels_count( int sound_channels_type ); typedef enum { SPECTRUM_48K_LIKE, SPECTRUM_128K_LIKE, TS2068_LIKE, PENTAGON_LIKE, SPECTRUM_NTSC_LIKE } fmf_machine_type; fmf_machine_type get_machine_type( char machine_type ); const char* get_machine_type_string(fmf_machine_type type); #endif /* FMFCONV_TYPES_H */ fuse-utils-1.5.1/compile0000755000175000017500000001760015267623710014225 0ustar00fredmfredm#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2025-06-18.21; # UTC # Copyright (C) 1999-2025 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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, 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file unneeded_conversions # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) UNNEEDED_CONVERSIONS, no # conversion will take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) if test -n "$MSYSTEM" && (cygpath --version) >/dev/null 2>&1; then # MSYS2 environment. file_conv=cygwin else # Original MinGW environment. file_conv=mingw fi ;; MSYS*) # Old MSYS environment, or MSYS2 with 32-bit MSYS2 shell. file_conv=cygwin ;; CYGWIN*) # Cygwin environment. file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) # This is the optimization mentioned above: # If UNNEEDED_CONVERSIONS contains $file_conv, don't convert. ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -w "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.lo | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . GNU Automake home page: . General help using GNU software: . EOF exit $? ;; -v | --v*) echo "compile (GNU Automake) $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ clang-cl | *[/\\]clang-cl | clang-cl.exe | *[/\\]clang-cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" # time-stamp-format: "%Y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: fuse-utils-1.5.1/rzxcheck_res.rc0000664000175000017500000000365015157611610015663 0ustar00fredmfredm/* rzxcheck_res.rc: resources for Windows executable Copyright (c) 2015 Sergio Baldovi 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. Author contact information: E-mail: serbalgi@gmail.com */ #include "config.h" #include /* VERSIONINFO specs: http://msdn.microsoft.com/en-us/library/aa381058%28VS.85%29.aspx */ VS_VERSION_INFO VERSIONINFO FILEVERSION FUSE_UTILS_RC_VERSION PRODUCTVERSION FUSE_UTILS_RC_VERSION FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0x0L FILEOS VOS__WINDOWS32 FILETYPE VFT_APP FILESUBTYPE VFT2_UNKNOWN BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904B0" BEGIN VALUE "CompanyName", "\0" VALUE "FileDescription", "Check the signature in a ZX Spectrum RZX file\0" VALUE "FileVersion", VERSION##"\0" VALUE "InternalName", "rzxcheck\0" VALUE "LegalCopyright", "Copyright (c) 2002-2003 Philip Kendall\0" VALUE "License", "rzxcheck is licensed under the GNU General Public License, version 2 or later\0" VALUE "OriginalFilename", "rzxcheck.exe\0" VALUE "ProductName", PACKAGE##"\0" VALUE "ProductVersion", VERSION##"\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1252 END END fuse-utils-1.5.1/snap2tzx.c0000664000175000017500000016030615253741146014607 0ustar00fredmfredm/* snap2tzx.c: Snapshot to .tzx tape image converter Copyright (c) 1997-2001 ThunderWare Research Center, written by Martijn van der Heide, 2003 Tomaz Kac, 2003 Philip Kendall, 2014-2015 Sergio Baldovi, 2018 Duncan Edwards 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. Author contact information: E-mail: philip-fuse@shadowmagic.org.uk */ #include "config.h" #include #include #include #include #include #include #include "libspectrum.h" #include "compat.h" #include "utils.h" #define PROGRAM_NAME "snap2tzx" char *progname; /* argv[0] */ typedef struct settings_t { const char *input_filename; /* Snapshot file to convert */ const char *external_filename; /* External screenshot */ char output_filename[512]; /* Target filename */ char loader_name[9]; /* Name displayed by BASIC loader */ char game_name[33]; /* Name displayed while game is loading */ char info1[33], info2[33]; /* Extra lines displayed while loading */ int speed; /* Loader speed */ int load_colour; /* Border colour */ libspectrum_byte bright; /* Should final attributes line be bright? */ } settings_t; static libspectrum_byte WorkBuffer[65535]; static int verbose = 0; static void print_error( const char *format, ... ) GCC_PRINTF( 1, 2 ); static void print_verbose( const char *format, ... ) GCC_PRINTF( 1, 2 ); static void print_error( const char *format, ... ) { va_list ap; fprintf( stderr, "%s: ", progname ); va_start( ap, format ); vfprintf( stderr, format, ap ); va_end( ap ); fprintf( stderr, "\n" ); } static void print_verbose( const char *format, ... ) { va_list ap; if( !verbose ) return; va_start( ap, format ); vprintf( format, ap ); va_end( ap ); } static void crunch_z80 (libspectrum_byte *BufferIn, libspectrum_word BlLength, libspectrum_byte *BufferOut, size_t *CrunchedLength) /**********************************************************************************************************************************/ /* Pre : `BufferIn' points to the uncrunched spectrum block, `BlLength' holds the length, `BufferOut' points to the result. */ /* `CrunchedLength' is the length after crunching. */ /* The version of Z80 file must have been determined. */ /* Post : The block has been crunched from `BufferIn' to `BufferOut'. */ /* If the crunched size is larger than (or equal to) the non-crunched size, the block is returned directly with */ /* `CrunchedLength' set to 0x0000. */ /* The crunched block is returned reversed (for backward loading). */ /* Import: None. */ /**********************************************************************************************************************************/ { register libspectrum_word IndexIn; register libspectrum_word IndexOut = 0; libspectrum_word LengthOut; register libspectrum_word RunTimeLength; int CrunchIt = 0; libspectrum_byte RepeatedCode; libspectrum_byte PrevByte = 0x00; libspectrum_byte *BufferTemp; BufferTemp = WorkBuffer + (libspectrum_word)32768; /* Use the top 16Kb of Workbuffer */ for (IndexIn = 0 ; IndexIn < BlLength - 4 ; IndexIn ++) /* Crunch it into the second buffer */ { if (*(BufferIn + IndexIn) == 0xED && /* Exceptional cases */ *(BufferIn + IndexIn + 1) == 0xED) CrunchIt = 1; else if (*(BufferIn + IndexIn) == *(BufferIn + IndexIn + 1) && *(BufferIn + IndexIn) == *(BufferIn + IndexIn + 2) && *(BufferIn + IndexIn) == *(BufferIn + IndexIn + 3) && *(BufferIn + IndexIn) == *(BufferIn + IndexIn + 4) && /* At least 5 repeats ? */ PrevByte != 0xED) /* Not right after a 0xED! */ CrunchIt = 1; if (CrunchIt) /* Crunch a block ? */ { CrunchIt = 0; RunTimeLength = 1; RepeatedCode = *(BufferIn + IndexIn); while (RunTimeLength < 255 && RunTimeLength + IndexIn < BlLength && *(BufferIn + RunTimeLength + IndexIn) == RepeatedCode) RunTimeLength ++; *(BufferTemp + (IndexOut ++)) = 0xED; *(BufferTemp + (IndexOut ++)) = 0xED; *(BufferTemp + (IndexOut ++)) = (libspectrum_byte) RunTimeLength; *(BufferTemp + (IndexOut ++)) = RepeatedCode; IndexIn += RunTimeLength - 1; PrevByte = 0x00; } else PrevByte = *(BufferTemp + (IndexOut ++)) = *(BufferIn + IndexIn); /* No, just copy */ } while (IndexIn < BlLength) *(BufferTemp + (IndexOut ++)) = *(BufferIn + (IndexIn ++)); /* Copy last ones */ if (IndexOut >= BlLength) /* Compressed larger than uncompressed ? */ { memcpy (BufferTemp, BufferIn, BlLength); /* Return the inputblock uncompressed */ LengthOut = BlLength; IndexOut = 0x0000; /* Signal: not compressed */ } else LengthOut = IndexOut; BufferTemp = WorkBuffer + (libspectrum_word)32768 + LengthOut - 1; /* Point to the last crunched byte */ for (IndexIn = 0 ; IndexIn < LengthOut ; IndexIn ++) /* Now reverse the result for backward loading */ *(BufferOut + IndexIn) = *(BufferTemp - IndexIn); *CrunchedLength = IndexOut; } static int test_rev_decz80( libspectrum_byte *source, int final_len, int source_len ) { /* source is reversed !!! */ int dst_pnt = final_len-1; int src_pnt = source_len-1; int overwrite = 0; libspectrum_byte b1; libspectrum_byte b2; libspectrum_byte times; while (dst_pnt >=0 && !overwrite) { b1 = source[src_pnt]; src_pnt--; b2 = source[src_pnt]; if (b1 == 0xED && b2 == 0xED) { /* Repeat */ times = source[src_pnt-1]; dst_pnt -= times; src_pnt-=3; } else { dst_pnt--; } if (dst_pnt < src_pnt) { overwrite = 1; } } return overwrite; } static void reverse_block (libspectrum_byte *BufferOut, libspectrum_byte *BufferIn) { register libspectrum_word Cnt; libspectrum_byte *BIn; libspectrum_byte *BOut; for (BIn = BufferIn, BOut = BufferOut + 16383, Cnt = 0 ; Cnt < 16384 ; Cnt ++) *(BOut --) = *(BIn ++); } static int initialise_settings( settings_t *settings ) { settings->input_filename = NULL; settings->external_filename = NULL; settings->loader_name[0] = '\0'; settings->game_name[0] = '\0'; /* 32 spaces */ strncpy( settings->info1, " ", 33 ); strncpy( settings->info2, " ", 33 ); settings->speed = 5; settings->load_colour = -1; settings->bright = 0x00; return 0; } /* Replace any occurences of '~' in 'buffer' with the copyright symbol (0x7f in the Spectrum's character set) */ static void change_copyright( char *buffer ) { for( ; *buffer; buffer++ ) if( *buffer == '~' ) *buffer = 0x7f; } static void centre_name( char *name ) { int i, num; for( i=31; i >=0 && name[i]==' '; i-- ); num = 31-i; if( num>1 ) { for( i=31; i >= num/2; i-- ) name[i] = name[i-(num/2)]; for( i=0; i < num/2; i++ ) name[i]=' '; } } static int setup_string( char *dest, size_t length, const char *src ) { snprintf( dest, length + 1, "%*s", (int)-length, src ); change_copyright( dest ); centre_name( dest ); return 0; } static void print_help( void ) { printf( "Usage: %s [OPTION...] \n" "Converts a ZX Spectrum snapshot into a .tzx tape image.\n" "\n" "Options:\n" "\n" " -1 s Show string 's' when loading (max 32 characters)\n" " -2 s Another line when loading (max 32 characters)\n" " -b n Border colour\n" " -g s Use 's' as the game name when loading (max 32 characters)\n" " -l s Use 's' as the BASIC filename (max 8 characters)\n" " -o f Output to file 'f'\n" " -r Make final attribute line BRIGHT\n" " -s n Set loading speed: 0: 1500 1: 2250 2: 3000 3: 4500 4: 5000 5: 6000 bps\n" " -v Verbose output\n" " -$ f Use .scr file 'f' as the loading screen\n" " -h Display this help and exit\n" " -V Output version information and exit\n" "\n" "In string parameters, the copyright symbol will be substituted for '~'.\n" "\n" "Report %s bugs to <%s>\n" "%s home page: <%s>\n" "For complete documentation, see the manual page of %s.\n", progname, PROGRAM_NAME, PACKAGE_BUGREPORT, PACKAGE_NAME, PACKAGE_URL, PROGRAM_NAME ); } static void print_version( void ) { printf( PROGRAM_NAME " (" PACKAGE ") " PACKAGE_VERSION "\n" "Copyright (c) 1997-2001 ThunderWare Research Center, written by\n" " Martijn van der Heide,\n" "Copyright (c) 2003 Tomaz Kac,\n" "Copyright (c) 2003 Philip Kendall\n" "License GPLv2+: GNU GPL version 2 or later " "\n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" ); } static int parse_args( settings_t *settings, int argc, char **argv ) { int c, got_game_name, got_loader_name, got_out_filename, error; char *buffer, *buffer2, *last_dot; struct option long_options[] = { { "help", 0, NULL, 'h' }, { "version", 0, NULL, 'V' }, { 0, 0, 0, 0 } }; error = initialise_settings( settings ); if( error ) return error; got_game_name = got_loader_name = got_out_filename = 0; while( ( c = getopt_long( argc, argv, "1:2:b:g:l:o:rs:v$:hV", long_options, NULL ) ) != -1 ) { switch (c) { case '1': error = setup_string( settings->info1, 32, optarg ); if( error ) return error; break; case '2': error = setup_string( settings->info2, 32, optarg ); if( error ) return error; break; /* Border Colour when loading */ case 'b': settings->load_colour = atoi( optarg ); if( settings->load_colour < 0 || settings->load_colour > 7 ) { print_error( "invalid border colour (%d)", settings->load_colour ); return 1; } break; /* Game Name (When Loader is loaded) */ case 'g': error = setup_string( settings->game_name, 32, optarg ); if( error ) return error; got_game_name = 1; break; /* Loader Name (Loading: Name) */ case 'l': snprintf( settings->loader_name, 9, "%-8s", optarg ); got_loader_name = 1; break; /* Output Filename */ case 'o': strncpy( settings->output_filename, optarg, 511 ); settings->output_filename[511] = 0; got_out_filename = 1; break; case 'r': settings->bright = 0x40; break; /* Speed value */ case 's': settings->speed = atoi( optarg ); if( settings->speed < 0 || settings->speed > 5 ) { print_error( "invalid speed (%d)", settings->speed ); return 1; } break; /* Verbose output */ case 'v': verbose = 1; break; /* External Loading Screen */ case '$': settings->external_filename = optarg; break; case 'h': print_help(); exit( 0 ); case 'V': print_version(); exit( 0 ); case '?': /* getopt prints an error message to stderr */ return 1; default: print_error( "%s: unknown option `%c'\n", progname, (char) c ); return 1; } } if( argv[optind] == NULL ) { fprintf( stderr, "%s: usage: %s [OPTION...] \n", progname, progname ); return 1; } /* Snapshot filename */ settings->input_filename = argv[ optind ]; /* Get the basename without the last extension. Not always going to be exactly what we want ('gamename.z80.gz') but will be close to right in most cases */ buffer = strdup( settings->input_filename ); if( !buffer ) { print_error( "out of memory at %s:%d", __FILE__, __LINE__ ); return 1; } buffer2 = compat_basename( buffer ); last_dot = strrchr( buffer2, '.' ); if( last_dot ) *last_dot = '\0'; if( !got_out_filename ) { /* 4 characters less than the size of the buffer so we will always have room to append ".tzx" */ strncpy( settings->output_filename, buffer2, 507 ); settings->output_filename[507] = '\0'; strcat( settings->output_filename, ".tzx" ); } if( !got_loader_name ) snprintf( settings->loader_name, 9, "%-8s", buffer2 ); if( !got_game_name ) { error = setup_string( settings->game_name, 32, buffer2 ); if( error ) return error; } free( buffer ); return 0; } static int load_snap( libspectrum_snap **snap, const char *filename ) { int error; libspectrum_file file; *snap = libspectrum_snap_alloc(); if( read_file( filename, &file ) ) { libspectrum_snap_free( *snap ); return 1; } error = libspectrum_snap_read( *snap, file.buffer, file.length, file.type, file.filename ); if( error ) { libspectrum_snap_free( *snap ); libspectrum_file_clear( &file ); return error; } libspectrum_file_clear( &file ); return 0; } /* Length of the BASIC part before the loader code */ #define basic_length 224-87+12-1+41+41 /* == 230 == 0xe6 */ static const libspectrum_byte SpectrumBASICData[ basic_length + 1 ] = { /* 0 {INK 255}{PAPER 255}BORDER PI-PI : PAPER PI-PI : INK PI-PI : CLS PRINT "{AT 6,0}{INK 5} {AT 12,9}{INK 6}{PAPER 2}{FLASH 1} NOW LOADING {AT 0,0}{FLASH 0}{PAPER 0}{INK 0}": RANDOMIZE USR (PEEK VAL "23627"+VAL "256"*PEEK VAL "23628") */ "\x00\x00\xFF\xFF\x10\xFF\x11\xFF\xE7\xA7\x2D\xA7\x3A\xDA\xA7\x2D\xA7\x3A\xD9\xA7\x2D\xA7\x3A\xFB\x3A" "\xF5\"\x16\x06\x00\x10\x05"" " "\x16\x0B\x0A\x10\x06\x11\x02\x12\x01 IS LOADING \x16\x00\x00\x12\x00\x11\x00\x10\x00\"" "\x3A\xF5\"\x16\x13\x00\x10\x04"" ""\"" "\x3A\xF5\"\x16\x15\x00\x10\x04"" ""\"" "\x3A\xF9\xC0(\xBE\xB0\"23627\"+\xB0\"256\"*\xBE\xB0\"23628\")\x0D" /* Variables area - the 768 byte loader block is appended after this piece */ "\xCD\x52\x00" /* VARSTART CALL 0052,RET_INSTR ; Determine on which address we are now */ "\x3B" /* RETRET DEC SP */ "\x3B" /* DEC SP */ "\xE1" /* POP HL */ "\x01\x12\x00" /* LD BC,0012 */ "\x09" /* ADD HL,BC ; Find start of the 768 byte loader */ "\x11\x00\xBD" /* LD DE,+BD00 */ "\x01\x00\x03" /* LD BC,+0300 */ "\xED\xB0" /* LDIR ; Move it into place */ "\xC3\x00\xBD" }; /* JP BD00,LDSTART ; And run it! */ /* The offsets into SpectrumBASICData where the user-settable strings are stored */ static const size_t basic_game_name_offset = 32; static const size_t basic_info1_offset = 103; static const size_t basic_info2_offset = 144; /**********************************************************************************************************************************/ /* The custom loader. Any speed can be handled by it. */ /* Notice that the EAR bit value is NOT rotated as opposed to the ROM and is kept at 0x40! */ /* ROM speed: a = 22, b = 25 (bd = 27) => delay = 32*22 = 704, sampler = 59*25 = 1475 => delay/sampler = 1/2 */ /* Max speed: a = 1, b = 0 (bd = 2) => 279 + 32 = 311 (hb0 = 156 T) => 468 average bit => 7479 bps */ /* (see below) The pilot pulse must be between 1453 + 16a T and 3130 + 16a T (a=known) */ /* (see below) The first sync pulse must be 840 + 16a T maximum (a=known) */ /* Average bit length = 3,500,000 / speed : (a=x, b=2x - so delay/sampler is kept at 1/2) */ /* 1364 bps => 2566 T => hb0 = 855 T, hb1 = 1710 T, avg = 1283 (2565) T <-- ROM speed */ /* 279 + 32a + 43b = 2565 => 32x + 86x = 2286 => 118x = 2286 => x = 19.4 */ /* 279 + 32*20 + 43*39 = 2596 (2565 needed), so a = 20, b = 39, bd = 41 */ /* PilotMin = 1453 + 16a = 1453 + 16*20 = 1773 T */ /* PilotMax = 3130 + 16a = 3130 + 16*20 = 3450 T => 2168 T */ /* Sync0 = 840 + 16a = 840 + 16*20 = 1160 T => 667 T */ /* 2250 bps => 1556 T => hb0 = 518 T, hb1 = 1036 T, avg = 777 (1554) T */ /* 279 + 32a + 43b = 1554 => 32x + 86x = 1275 => 118x = 1275 => x = 10.8 */ /* 279 + 32*11 + 43*22 = 1577 (1554 needed), so a = 11, b = 22, bd = 24 */ /* PilotMin = 1453 + 16a = 1453 + 16*11 = 1629 T */ /* PilotMax = 3130 + 16a = 3130 + 16*11 = 3306 T => 2000 T */ /* Sync0 = 840 + 16a = 840 + 16*11 = 1016 T => 600 T */ /* 3000 bps => 1167 T => hb0 = 389 T, hb1 = 778 T, avg = 584 (1167) T */ /* 279 + 32a + 43b = 1167 => 32x + 86x = 888 => 118x = 888 => x = 7.5 */ /* 279 + 32*7 + 43*16 = 1191 (1167 needed), so a = 7, b = 16, bd = 18 */ /* PilotMin = 1453 + 16a = 1453 + 16*7 = 1565 T */ /* PilotMax = 3130 + 16a = 3130 + 16*7 = 3242 T => 1900 T */ /* Sync0 = 840 + 16a = 840 + 16*7 = 952 T => 550 T */ /* 4500 bps => 778 T => hb0 = 259 T, hb1 = 519 T, avg = 389 (778) T */ /* 279 + 32a + 43b = 778 => 32x + 86x = 449 => 118x = 499 => x = 4.2 */ /* 279 + 32*5 + 43*8 = 783 (778 needed), so a = 5, b = 8, bd = 10 */ /* PilotMin = 1453 + 16a = 1453 + 16*5 = 1533 T */ /* PilotMax = 3130 + 16a = 3130 + 16*5 = 3210 T => 1900 T */ /* Sync0 = 840 + 16a = 840 + 16*5 = 920 T => 550 T */ /* 5000 bps => 700 T => hb0 = 234 T, hb1 = 468 T, avg = 351 (702) T */ /* 279 + 32a + 43b = 702 => 32x + 86x = 423 => 118x = 423 => x = 3.5 */ /* 279 + 32*4 + 43*7 = 708 (702 needed), so a = 4, b = 7, bd = 9 */ /* PilotMin = 1453 + 16a = 1453 + 16*4 = 1517 T */ /* PilotMax = 3130 + 16a = 3130 + 16*4 = 3194 T => 1800 T */ /* Sync0 = 840 + 16a = 840 + 16*4 = 904 T => 500 T */ /* 6000 bps => 584 T => hb0 = 195 T, hb1 = 390 T, avg = 293 (585) T */ /* 279 + 32a + 43b = 585 => 32x + 86x = 306 => 118x = 306 => x = 2.6 */ /* 279 + 32*3 + 43*5 = 590 (585 needed), so a = 3, b = 5, bd = 7 */ /* PilotMin = 1453 + 16a = 1453 + 16*3 = 1501 T */ /* PilotMax = 3130 + 16a = 3130 + 16*3 = 3178 T => 1700 T */ /* Sync0 = 840 + 16a = 840 + 16*3 = 888 T => 450 T */ /**********************************************************************************************************************************/ typedef struct turbo_variables_t { /* Variables actually used in the loader */ libspectrum_byte compare; /* Variable 'bd' + starting value (+80) */ libspectrum_byte delay; /* Variable 'a' */ /* Variables used in the TZX header */ libspectrum_dword pilot_length; /* length of a pilot pulse. Number of pulses is calculated to make the pilot 1 second long */ libspectrum_dword sync_length; /* both equal */ libspectrum_dword bit_length; /* reset length; set length is twice this */ } turbo_variables_t; static const turbo_variables_t turbo_variables[] = { { 0x80 + 41, 20, 2168, 667, 855 }, /* ROM values => 1364 bps */ { 0x80 + 24, 11, 2000, 600, 518 }, /* 2250 bps */ { 0x80 + 18, 7, 1900, 550, 389 }, /* 3000 bps */ { 0x80 + 10, 5, 1900, 550, 259 }, /* 4500 bps */ { 0x80 + 9, 4, 1850, 525, 234 }, /* 5000 bps */ { 0x80 + 7, 3, 1700, 450, 200 }, /* 6000 bps */ }; #define turbo_loader_length 144 /* 'compare' is at offset 94 'delay' is at offset 118 'xor colour' is at offset 134 */ static const libspectrum_byte turbo_loader[ turbo_loader_length + 1 ] = { "\xCD\x5B\xBF" /* LD_BLOCK CALL LD_BYTES */ "\xD8" /* RET C */ "\xCF" /* RST 0008,ERROR_1 */ "\x1A" /* DEFB +1A ; R Tape Loading Error */ "\x14" /* LD_BYTES INC D */ "\x08" /* EX AF,AF' */ "\x15" /* DEC D */ "\x3E\x08" /* LD A,+08 (Border BLACK + MIC off) */ "\xD3\xFE" /* OUT (+FE),A */ "\xDB\xFE" /* IN A,(+FE) */ "\xE6\x40" /* AND +40 */ "\x4F" /* LD C,A (BLACK/chosen colour) */ "\xBF" /* CP A */ "\xC0" /* LD_BREAK RET NZ */ "\xCD\xCA\xBF" /* LD_START CALL LD_EDGE_1 */ "\x30\xFA" /* JR NC,LD_BREAK */ "\x26\x00" /* LD H,+80 */ /* Each subsequent 2 edges take: 65 + LD_EDGE_2 T = 283 + 32a + 43b T, bd = b + 2 */ /* Minimum: */ /* ROM => b = (+C6 - +9C - 2) + 1 = 41, a=22 => 427 + 32a + 59b T => 427 + 32*22 + 59*41 T = 3550 T */ /* 283 + 32a + 43b = 3432, a=20 => 283 + 32*20 + 43b = 3550 => 43b = 2627 => b = 61, bd = 63 */ /* b = 61, so each 2 leader pulses must fall within: */ /* 283 + 32a + 43*61 T = 2906 + 32a T */ /* One leader pulse must therefore be (2906 + 32a) / 2 = 1453 + 16a T minimum */ /* Maximum, at timeout: */ /* ROM => b = +100 - +9C - 2 = 98, a=22 => 427 + 32a + 59b T => 427 + 32*22 + 59*98 T = 6913 T */ /* 283 + 32a + 43b = 6913, a=20 => 283 + 32*20 + 43b = 6913 => 43b = 6002 => b = 139, bd = 141 */ /* b = 139, so each 2 leader pulses must fall within: */ /* 283 + 32a + 43*139 T = 6260 + 32a T */ /* One leader pulse must therefore be (6260 + 32a) / 2 = 3130 + 16a T maximum */ /* Notice that, as opposed to the ROM, we don't need the leader to be over a second. Only 256 pulses are */ /* required (128 * 2 edges, counted in H). */ "\x06\x75" /* LD_LEADER LD B,+73 7 */ "\xCD\xC6\xBF" /* CALL LD_EDGE_2 17 */ "\x30\xF1" /* JR NC,LD_BREAK 7 (/12) */ "\x3E\xB0" /* LD A,+B2 7 */ "\xB8" /* CP B 4 */ "\x30\xED" /* JR NC,LD_START 7 (/12) */ "\x24" /* INC H 4 */ "\x20\xF1" /* JR NZ,LD_LEADER 7/12 */ /* Each subsequent edge takes: 54 + LD_EDGE_1 T = 152 + 16a + 43b T, bd = b + 1 */ /* Sync0 maximum: */ /* ROM => b = +D4 - +C9 - 1 = 10, a=22 => 224 + 16a + 59b T => 224 + 16*22 + 59*10 T = 1166 T */ /* 152 + 16a + 43b = 1166, a=20 => 152 + 16*20 + 43b = 1166 => 43b = 694 => b = 16, bd = 17 */ /* b = 16, so the (first) sync pulse must be less than: */ /* 152 + 16a + 43*16 T = 840 + 16a T */ /* Leader maximum (at timeout): */ /* ROM => b = +100 - +C9 - 1 = 56, a=22 => 224 + 16a + 59b T => 224 + 16*22 + 59*56 T = 3880 T */ /* 152 + 16a + 43b = 3880, a=20 => 152 + 16*20 + 43b = 3880 => 43b = 3408 => b = 79, bd = 80 */ /* Notice that this leader maximum is higher than above, so is not needed to be considered */ "\x06\xB0" /* LD_SYNC LD B,+B0 7 */ "\xCD\xCA\xBF" /* CALL LD_EDGE_1 17 */ "\x30\xE2" /* JR NC,LD_BREAK 7 (/12) */ "\x78" /* LD A,B 4 */ "\xFE\xC1" /* CP +C1 7 */ "\x30\xF4" /* JR NC,LD_SYNC 7/12 */ "\xCD\xCA\xBF" /* CALL LD_EDGE_1 17 */ "\xD0" /* RET NC 5 (/11) */ "\x26\x00" /* LD H,+00 7 */ "\x06\x80" /* LD B,+80 7 */ "\x18\x17" /* JR LD_MARKER 12 = 48S */ "\x08" /* LD_LOOP EX AF,AF' 4 */ "\x20\x05" /* JR NZ,LD_FLAG 7/12 = 16F */ "\xDD\x75\x00" /* LD (IX+00),L 19 */ "\x18\x09" /* JR LD_NEXT 12 = 42D */ "\xCB\x11" /* LD_FLAG RL C 4 */ "\xAD" /* XOR L 4 */ "\xC0" /* RET NZ 5 (/11) */ "\x79" /* LD A,C 4 */ "\x1F" /* RRA 4 */ "\x4F" /* LD C,A 4 */ "\x18\x03" /* JR LD_FLNEXT 12 = 37F */ "\xDD\x2B" /* LD_NEXT DEC IX 10 (We're loading BACKWARD!) */ "\x1B" /* DEC DE 6 */ "\x08" /* LD_FLNEXT EX AF,AF' 4 */ "\x06\x82" /* LD B,+82 7 */ "\x2E\x01" /* LD_MARKER LD L,+01 7 = 34D/18F/7S */ /* The very first (flag) bit takes (S) = 48 + 7 = 55 + LD_EDGE_2 T = 273 + 32a + 43b T */ /* (D) 55 + 32 + 42 + 34 = 163, so */ /* Each first (data) bit takes: 163 + LD_EDGE_2 - 2b T = 295 + 32a + 43b T (ROM = 405 + 32a + 59b T) */ /* Each subsequent bit takes: 60 + LD_EDGE_2 T = 278 + 32a + 43b T (ROM = 422 + 32a + 59b T) */ "\xCD\xC6\xBF" /* LD_8_BITS CALL LD_EDGE_2 17 */ "\xD0" /* RET NC 5 (/11) */ "\x3E" /* LD A,COMPARE 7 (variable 'bd') */ "\x00" /* COMPARE !!! */ "\xB8" /* CP B 4 */ "\xCB\x15" /* RL L 8 */ "\x06\x80" /* LD B,+80 7 */ "\x30\xF3" /* JR NC,LD_8_BITS 7/12 = 55D/60N */ "\x7C" /* LD A,H 4 */ "\xAD" /* XOR L 4 */ "\x67" /* LD H,A 4 */ "\x7A" /* LD A,D 4 */ "\xB3" /* OR E 4 */ "\x20\xD3" /* JR NZ,LD_LOOP (7/) 12 = 32D */ "\x7C" /* LD A,H */ "\xFE\x01" /* CP +01 */ "\xC9" /* RET */ /* The LD_EDGE_2 routine takes: 22 + 2 * (98 + 16a) + 43b T = 218 + 32a + 43b T (ROM = 362 + 32a + 59b T), bd = b + 2 */ "\xCD\xCA\xBF" /* LD_EDGE_2 CALL LD_EDGE_1 17 */ "\xD0" /* RET NC 5 (/11) */ /* The LD_EDGE_1 routine takes: 98 + 16a + 43b T (ROM = 170 + 16a + 59b T, a=22), bd = b + 1 */ "\x3E" /* LD_EDGE_1 LD A,DELAY 7 (variable 'a') */ "\x00" /* DELAY !!! */ "\x3D" /* LD_DELAY DEC A 4 */ "\x20\xFD" /* JR NZ,LD_DELAY 7/12 */ "\xA7" /* AND A 4 */ "\x04" /* LD_SAMPLE INC B 4 (variable 'b') */ "\xC8" /* RET Z 5 (/11) */ "\xDB\xFE" /* IN A,(+FE) 11 */ "\xA9" /* XOR C 4 */ "\xE6\x40" /* AND +40 7 */ "\x28\xF7" /* JR Z,LD_SAMPLE 7/12 = 43 */ "\x79" /* LD A,C 4 */ "\xEE" /* XOR COLOUR 7 */ "\x00" /* XOR COLOUR !!! */ "\x4F" /* LD C,A 4 */ "\xE6\x07" /* AND +07 7 */ "\xF6\x08" /* OR +08 7 */ "\xD3\xFE" /* OUT (+FE),A 11 */ "\x37" /* SCF 4 */ "\xC9" }; /* RET 10 */ typedef struct page_t /* Each page as found in a Z80 file */ { libspectrum_byte page; /* Spectrum value, not value from .z80 file */ libspectrum_word address; /* Normal (non-paged) start address of this 16Kb chunk */ } page_t; static const page_t PageOrder48S[4] = { { 255, 0xc000 }, /* external loading screen */ { 2, 0x8000 }, { 0, 0xc000 }, { 5, 0x4000 } /* must be decompressed */ }; static const page_t PageOrder128S[9] = { { 255, 0xc000 }, /* external loading screen */ { 2, 0x8000 }, { 1, 0xc000 }, { 3, 0xc000 }, { 4, 0xc000 }, { 6, 0xc000 }, { 7, 0xc000 }, { 0, 0xc000 }, { 5, 0x4000 } /* must be decompressed */ }; static const page_t PageOrder48N[3] = { { 5, 0xc000 }, /* loading screen from memory */ { 2, 0x8000 }, { 0, 0xc000 } }; static const page_t PageOrder128N[8] = { { 5, 0xc000 }, /* loading screen from memory */ { 2, 0x8000 }, { 1, 0xc000 }, { 3, 0xc000 }, { 4, 0xc000 }, { 6, 0xc000 }, { 7, 0xc000 }, { 0, 0xc000 } }; static const size_t loader_length = 0x300; static const libspectrum_byte loader_data[ 0x300 ] = {0xF3,0x31,0x00,0xC0,0xCD,0x91,0xBE,0xDD,0x21,0x6C,0xBE,0x21,0xBB,0xBB,0x11 ,0xCC,0xCC,0x01,0xDD,0xDD,0xD9,0xFD,0x21,0xFF,0xFF,0xDD,0x7E,0x00,0xA7,0x28 ,0x50,0xDD,0x66,0x01,0x2E,0xFF,0xDD,0x5E,0x02,0xDD,0x56,0x03,0x01,0xFD,0x7F ,0xED,0x79,0x01,0x04,0x00,0xDD,0x09,0xDD,0xE5,0xD5,0x7A,0xB3,0x20,0x0D,0x11 ,0x00,0x40,0xDD,0x7E,0xFC,0xFE,0x12,0x20,0x03,0x11,0x00,0x3D,0xE5,0xDD,0xE1 ,0x3E,0xAA,0x37,0xCD,0x55,0xBF,0xC1,0xDD,0xE5,0xE1,0x23,0xCD,0x44,0xBE,0x11 ,0x01,0x00,0xFD,0x19,0x30,0x0B,0x21,0x00,0xC0,0x11,0x00,0x40,0x01,0x00,0x40 ,0xED,0xB0,0xDD,0xE1,0x18,0xAA,0xFD,0x21,0xAA,0xAA,0x21,0xE0,0x5A,0x06,0x20 ,0x3E,0xFF,0x77,0x23,0x10,0xFC,0x21,0xC8,0xBD,0x11,0xE0,0x57,0x0E,0x20,0xED ,0xB0,0x11,0xE0,0x56,0x0E,0x1F,0xED,0xB0,0x11,0xE0,0x55,0x0E,0x09,0xED,0xB0 ,0x11,0xE0,0x54,0x0E,0x20,0xED,0xB0,0x11,0xE0,0x53,0x0E,0x14,0xED,0xB0,0x3E ,0xCC,0x3C,0x20,0x11,0x31,0xEA,0x52,0xDD,0x21,0x00,0xBD,0x11,0x00,0x03,0x3E ,0x55,0xBC,0x08,0xC3,0xE0,0x57,0x21,0x00,0xBD,0x11,0x01,0xBD,0x01,0xFF,0x02 ,0x36,0x00,0xC3,0xE0,0x57,0xCD,0x62,0x05,0x31,0xE0,0x54,0x16,0x10,0x01,0xFD ,0xFF,0x15,0xED,0x51,0xF1,0x06,0xBF,0xED,0x79,0x7A,0xA7,0x20,0xF1,0x06,0xFF ,0x3E,0xBB,0xED,0x79,0xC3,0xE3,0x56,0xCD,0x62,0x05,0x31,0xE0,0x53,0xF1,0xD3 ,0xFE,0xC1,0xF1,0xED,0x79,0xDD,0xE1,0xF1,0x08,0xE1,0x7C,0xED,0x47,0x7D,0xED ,0x4F,0xE1,0xD1,0xC1,0xF1,0xC3,0xE0,0x55,0x31,0xBB,0xAA,0xED,0x56,0xF3,0xC3 ,0xDD,0xCC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x01,0xFD,0x7F,0x00,0x02,0x03,0x04,0x05,0x06,0x07 ,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0x10,0x7C,0xE6,0xC0,0x57,0x1E,0x00 ,0x78,0xB1,0xC8,0x7E,0xFE,0xED,0x20,0x05,0x23,0xBE,0x28,0x05,0x2B,0xED,0xA0 ,0x18,0xEF,0x23,0xC5,0x46,0x23,0x7E,0x23,0x12,0x13,0x10,0xFC,0xC1,0x0B,0x0B ,0x0B,0x0B,0x18,0xDE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0xFE,0x5A,0x36 ,0x0D,0x23,0x36,0x0D,0x06,0x08,0x21,0xB4,0xBE,0xDD,0x21,0xFE,0x50,0x56,0xDD ,0x72,0x00,0x23,0x56,0xDD,0x72,0x01,0x23,0x11,0x00,0x01,0xDD,0x19,0x10,0xEF ,0xC9,0x00,0x00,0x7F,0xFE,0x48,0x02,0x08,0xF8,0x08,0x80,0x08,0x82,0x3E,0xFE ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00}; /* end binary data. size = 768 bytes */ static libspectrum_byte calc_checksum( libspectrum_byte *data, size_t length ) { size_t i; libspectrum_byte checksum; for( i=0, checksum = 0; i < length; i++, data++ ) checksum ^= *data; return checksum; } static int add_rom_block( libspectrum_tape *tape, const libspectrum_byte flag, const libspectrum_byte *data, const size_t length ) { libspectrum_byte *buffer; libspectrum_tape_block *block; buffer = malloc( ( length + 2 ) * sizeof( libspectrum_byte ) ); if( !buffer ) { print_error( "out of memory at %s:%d", __FILE__, __LINE__ ); return 1; } block = libspectrum_tape_block_alloc( LIBSPECTRUM_TAPE_BLOCK_ROM ); libspectrum_tape_block_set_pause( block, 100 ); libspectrum_tape_block_set_data_length( block, length + 2 ); libspectrum_tape_block_set_data( block, buffer ); buffer[0] = flag; memcpy( buffer + 1, data, length ); buffer[ length + 1 ] = calc_checksum( buffer, length + 1 ); if( libspectrum_tape_append_block( tape, block ) ) { libspectrum_tape_block_free( block ); return 1; } return 0; } static int create_main_header( libspectrum_tape *tape, const char *loader_name ) { libspectrum_byte header[17], *ptr; size_t i, length; int error; ptr = header; *ptr++ = '\0'; /* BASIC program */ /* Filename */ *ptr++ = 0x11; *ptr++ = 0x05; /* PAPER 5 */ length = strlen( loader_name ); /* Character 0x08 is cursor left */ for( i = 0; i < 8; i++ ) *ptr++ = ( i <= length ? loader_name[i] : 0x08 ); /* Length of data block */ length = basic_length + loader_length; *ptr++ = length & 0xff; *ptr++ = length >> 8; /* Autostart line number */ *ptr++ = '\0'; *ptr++ = '\0'; /* Start of the variables area */ length = basic_length - 21; *ptr++ = length & 0xff; *ptr++ = length >> 8; error = add_rom_block( tape, 0x00, header, 17 ); if( error ) return error; return 0; } static void set_loader_speed( libspectrum_byte *buffer, int speed, libspectrum_byte border_colour ) { libspectrum_byte xor_colour; const turbo_variables_t *ptr; ptr = &turbo_variables[ speed ]; buffer[ 94] = ptr->compare; buffer[118] = ptr->delay; /* In general, use black/ as the colours for the loading stripes, unless the final colour is black, in which case we (somewhat arbitrarily) use black/blue */ xor_colour = ( border_colour == 0 ? 0x41 : 0x40 | border_colour ); buffer[134] = xor_colour; } static const size_t table_offset = 0x0253; static const size_t extra_block_flag_offset = 0x018c; static const size_t extra_block_clean1_offset = 0x01af; static const size_t extra_block_clean2_offset = 0x01cf; #define POS_HL2 0x00C /*2 H'L' */ #define POS_DE2 0x00F /*2 D'E' */ #define POS_BC2 0x012 /*2 B'C' */ #define POS_IY 0x071 /*2 IY */ #define POS_LAST_ATTR 0x079 /* Last Line Attribute value */ #define POS_48K_1 0x0B9 /* 0x56 = 48k , 0x57 = 128k */ #define POS_48K_2 0x0C7 /* as POS_48K_1 */ #define POS_LAST_AY 0x0E2 /* Last AY out byte */ #define POS_SP 0x108 /*2 SP */ #define POS_IM 0x10B /* IM: 0=0x46 , 1=0x56 , 2=0x5E */ #define POS_DIEI 0x10C /* DI=0xF3 , EI=0xFB */ #define POS_PC 0x10E /*2 PC */ #define POS_AYREG 0x110 /*2 16 AY registers, 1st byte = 0x00 */ #define POS_BORDER 0x131 /* Border Colour */ #define POS_PAGE 0x135 /* Current 128 page (0x10 if 48k) */ #define POS_IX 0x136 /*2 IX */ #define POS_F2 0x138 /* F' */ #define POS_A2 0x139 /* A' */ #define POS_R 0x13A /* R */ #define POS_I 0x13B /* I */ #define POS_HL 0x13C /*2 HL */ #define POS_DE 0x13E /*2 DE */ #define POS_BC 0x140 /*2 BC */ #define POS_F 0x142 /* F */ #define POS_A 0x143 /* A */ static void write_word( libspectrum_byte *dest, libspectrum_word src ) { *dest = src & 0xff; *(dest+1) = src >> 8; } static int snap_mode_128( libspectrum_snap *snap ) { libspectrum_machine machine; int capabilities; machine = libspectrum_snap_machine( snap ); capabilities = libspectrum_machine_capabilities( machine ); return( capabilities & LIBSPECTRUM_MACHINE_CAPABILITY_128_MEMORY ); } static int create_loader( libspectrum_byte *buffer, libspectrum_snap *snap, const settings_t *settings ) { int border_colour; size_t i, ppay; libspectrum_byte machine, attributes; border_colour = settings->load_colour; if( border_colour == -1 ) border_colour = libspectrum_snap_out_ula( snap ) & 0x07; /* Place the loader data into the buffer */ memcpy( buffer, loader_data, loader_length ); /* And then put the turbo loader code itself in */ memcpy( buffer + 341 + 256, turbo_loader, turbo_loader_length ); /* Fill the loader with appropriate speed values and colour */ set_loader_speed( buffer + 341 + 256, settings->speed, border_colour ); /* Set the registers etc */ write_word( buffer + POS_HL2, libspectrum_snap_hl_( snap ) ); write_word( buffer + POS_DE2, libspectrum_snap_de_( snap ) ); write_word( buffer + POS_BC2, libspectrum_snap_bc_( snap ) ); write_word( buffer + POS_IY, libspectrum_snap_iy( snap ) ); attributes = border_colour | ( border_colour << 3 ) | settings->bright; buffer[ POS_LAST_ATTR ] = attributes; machine = snap_mode_128( snap ) ? 0x57 : 0x56; buffer[ POS_48K_1 ] = buffer[ POS_48K_2 ] = machine; buffer[ POS_LAST_AY ] = libspectrum_snap_out_ay_registerport( snap ); write_word( buffer + POS_SP, libspectrum_snap_sp( snap ) ); switch( libspectrum_snap_im( snap ) ) { case 0: buffer[ POS_IM ] = 0x46; break; case 1: buffer[ POS_IM ] = 0x56; break; case 2: buffer[ POS_IM ] = 0x5E; break; } buffer[ POS_DIEI ] = libspectrum_snap_iff1( snap ) ? 0xfb : 0xf3; write_word( buffer + POS_PC, libspectrum_snap_pc( snap ) ); buffer[ POS_BORDER ] = border_colour; buffer[ POS_PAGE ] = snap_mode_128( snap ) ? libspectrum_snap_out_128_memoryport( snap ) : 0x10; write_word( buffer + POS_IX, libspectrum_snap_ix( snap ) ); buffer[ POS_F2 ] = libspectrum_snap_f_( snap ); buffer[ POS_A2 ] = libspectrum_snap_a_( snap ); buffer[ POS_R ] = libspectrum_snap_r( snap ) - 0x0a; buffer[ POS_I ] = libspectrum_snap_i( snap ); write_word( buffer + POS_HL, libspectrum_snap_hl( snap ) ); write_word( buffer + POS_DE, libspectrum_snap_de( snap ) ); write_word( buffer + POS_BC, libspectrum_snap_bc( snap ) ); buffer[ POS_F ] = libspectrum_snap_f( snap ); buffer[ POS_A ] = libspectrum_snap_a( snap ); for( i=0, ppay = POS_AYREG + 1; i < 16; i++, ppay += 2 ) buffer[ ppay ] = libspectrum_snap_ay_registers( snap, 15 - i ); return 0; } static int add_loader_block( libspectrum_tape *tape, libspectrum_byte **loader, libspectrum_snap *snap, const settings_t *settings ) { libspectrum_tape_block *block; libspectrum_byte *basic; size_t length; int error2; length = basic_length + loader_length + 2; *loader = malloc( length * sizeof( libspectrum_byte ) ); if( !(*loader) ) { print_error( "out of memory at %s:%d", __FILE__, __LINE__ ); return 1; } block = libspectrum_tape_block_alloc( LIBSPECTRUM_TAPE_BLOCK_ROM ); libspectrum_tape_block_set_pause( block, 100 ); libspectrum_tape_block_set_data_length( block, length ); libspectrum_tape_block_set_data( block, (*loader) ); (*loader)[0] = 0xff; /* Data block */ /* The BASIC data starts just after the flag byte */ basic = *loader + 1; /* Put the BASIC code into the buffer */ memcpy( basic, SpectrumBASICData, basic_length ); /* Copy the game name and info lines into the BASIC code */ memcpy( basic + basic_game_name_offset, settings->game_name, 32 ); memcpy( basic + basic_info1_offset, settings->info1, 32 ); memcpy( basic + basic_info2_offset, settings->info2, 32 ); /* Put the loader into the buffer */ error2 = create_loader( basic + basic_length, snap, settings ); if( error2 ) { libspectrum_tape_block_free( block ); return error2; } /* We don't calculate the checksum yet as we need to do it after we've put the page lengths in the data */ /* But put the block into the tape anyway */ if( libspectrum_tape_append_block( tape, block ) ) { libspectrum_tape_block_free( block ); return 1; } return 0; } static int create_turbo_header( libspectrum_tape_block *block, int speed ) { const turbo_variables_t *ptr; libspectrum_dword pilot_length; ptr = &turbo_variables[ speed ]; pilot_length = ptr->pilot_length; libspectrum_tape_block_set_pilot_length( block, pilot_length ); libspectrum_tape_block_set_pilot_pulses( block, 3500000UL / pilot_length ); libspectrum_tape_block_set_sync1_length( block, ptr->sync_length ); libspectrum_tape_block_set_sync2_length( block, ptr->sync_length ); libspectrum_tape_block_set_bit0_length( block, ptr->bit_length ); libspectrum_tape_block_set_bit1_length( block, ptr->bit_length * 2 ); libspectrum_tape_block_set_bits_in_last_byte( block, 8 ); libspectrum_tape_block_set_pause( block, 100 ); return 0; } static int get_loading_screen( libspectrum_byte *screen, const char *filename ) { FILE *f; size_t count; f = fopen( filename, "rb" ); if( !f ) { print_error( "error opening loading screen '%s': %s", filename, strerror( errno ) ); return 1; } count = fread( screen, 1, 6912, f ); if( count != 6912 ) { if( count == 0 ) { print_error( "error reading from '%s: %s", filename, strerror( errno ) ); } else { print_error( "could read only %lu bytes from '%s'", (unsigned long)count, filename ); } fclose( f ); return 1; } if( fclose( f ) ) { print_error( "error closing '%s': %s", filename, strerror( errno ) ); return 1; } return 0; } static int add_page( libspectrum_tape *tape, libspectrum_snap *snap, int page, libspectrum_word address, libspectrum_byte *loader, size_t *loader_table_entry, const settings_t *settings ) { libspectrum_tape_block *block; libspectrum_error error; size_t page_length, compressed_length, reverse_offset; libspectrum_byte table_byte, *buffer; block = libspectrum_tape_block_alloc( LIBSPECTRUM_TAPE_BLOCK_TURBO ); error = create_turbo_header( block, settings->speed ); if( error ) { libspectrum_tape_block_free( block ); return error; } reverse_offset = 0; if( page == 255 ) { /* External loading screen */ libspectrum_byte screen[ 0x1b00 ]; error = get_loading_screen( screen, settings->external_filename ); if( error ) { libspectrum_tape_block_free( block ); return error; } page_length = 0x1b00; crunch_z80( screen, page_length, WorkBuffer, &compressed_length ); table_byte = 0x10; /* compressed_length == 0 => block could not be compressed */ if( !compressed_length ) { print_verbose( "- adding separate loading screen (uncompressed) length: %04lx\n", (unsigned long)page_length ); } else { print_verbose( "- adding separate loading screen (compressed) length: %04lx\n", (unsigned long)compressed_length ); } } else { libspectrum_byte *data; int empty; size_t i; /* If this page wasn't in the snapshot, just move on to the next one */ data = libspectrum_snap_pages( snap, page ); if( !data ) return 0; page_length = 16384; if( snap_mode_128( snap ) ) { if( !(*loader_table_entry) ) { table_byte = 0x10; } else { table_byte = page | 0x10; } } else { table_byte = 0x10; } /* Have to special case the page at 0x8000 as it contains the loader */ if( address == 0x8000 ) { page_length -= loader_length; table_byte = 0x12; } for( empty = 1, i = 0; i < page_length; i++ ) if( data[i] ) { empty = 0; break; } if( empty ) return 0; /* Now crunch the block */ crunch_z80( data, page_length, WorkBuffer, &compressed_length ); if( settings->external_filename && page == 5 ) { /* Check if external screen is loading and last page selected If so then check if it would overwrite loading screen - if so then load decrunched */ if( compressed_length > page_length ) { reverse_block( WorkBuffer, data ); compressed_length = 0; /* Not compressed */ } } if( compressed_length != 0 ) { /* Check if it would overwrite itself */ if( test_rev_decz80( WorkBuffer, page_length, compressed_length ) ) { reverse_block( WorkBuffer, data ); reverse_offset = 0x4000 - page_length; compressed_length = 0; /* Not compressed */ } } if( compressed_length == 0 ) { print_verbose( "- adding memory page %d (uncompressed) length: %04lx\n", page, (unsigned long)page_length ); } else { print_verbose( "- adding memory page %d (compressed) length: %04lx\n", page, (unsigned long)compressed_length ); } } /* Fill in the table data */ address += page_length - 1; loader[ table_offset + ( *loader_table_entry * 4 ) ] = table_byte; loader[ table_offset + ( *loader_table_entry * 4 ) + 1 ] = address >> 8; write_word( &loader[ table_offset + ( *loader_table_entry * 4 ) + 2 ], compressed_length ); if( !compressed_length ) compressed_length = page_length; libspectrum_tape_block_set_data_length( block, compressed_length + 2 ); buffer = malloc( ( compressed_length + 2 ) * sizeof( libspectrum_byte ) ); if( !buffer ) { print_error( "out of memory at %s:%d", __FILE__, __LINE__ ); libspectrum_tape_block_free( block ); return 1; } buffer[0] = 0xaa; memcpy( &buffer[1], WorkBuffer + reverse_offset, compressed_length ); buffer[ compressed_length + 1 ] = calc_checksum( buffer, compressed_length + 1 ); libspectrum_tape_block_set_data( block, buffer ); (*loader_table_entry)++; if( libspectrum_tape_append_block( tape, block ) ) { libspectrum_tape_block_free( block ); return 1; } return 0; } /* Add a block to overwrite our loader code if needed */ static int add_extra_block( libspectrum_tape *tape, libspectrum_snap *snap, const page_t *page_order, size_t num_pages, libspectrum_byte *loader ) { libspectrum_byte *page; int empty, extra_block_needed, error; size_t i, j; extra_block_needed = 0; for( i = 0; i < num_pages; i++ ) { if( page_order[i].address != 0x8000 ) continue; page = libspectrum_snap_pages( snap, page_order[i].page ); for( empty = 1, j = 0x4000 - loader_length; j < 0x4000; j++ ) if( page[j] ) { empty = 0; break; } /* No need to load the data in if it is all zero */ if( empty ) break; print_verbose( "- adding extra ROM loading block\n" ); loader[ extra_block_flag_offset ] = 0xff; extra_block_needed = 1; error = add_rom_block( tape, 0x55, page + 0x4000 - loader_length, loader_length ); if( error ) return error; } if( !extra_block_needed ) { /* Unset the 768 load flag */ loader[ extra_block_flag_offset ] = 0x00; /* Change the loader code to a simple LDIR */ loader[ extra_block_clean1_offset ] = 0xed; loader[ extra_block_clean1_offset + 1 ] = 0xb0; loader[ extra_block_clean1_offset + 2 ] = 0x00; loader[ extra_block_clean2_offset ] = 0xed; loader[ extra_block_clean2_offset + 1 ] = 0xb0; loader[ extra_block_clean2_offset + 2 ] = 0x00; } return 0; } static int create_main_data( libspectrum_tape *tape, libspectrum_snap *snap, const settings_t *settings ) { int i, num_pages, error; const page_t *page_order; libspectrum_byte *loader; size_t loader_table_entry; error = add_loader_block( tape, &loader, snap, settings ); if( error ) return error; if( snap_mode_128( snap ) ) { if( settings->external_filename ) { num_pages = 9; page_order = PageOrder128S; } else { num_pages = 8; page_order = PageOrder128N; } } else { if( settings->external_filename ) { num_pages = 4; page_order = PageOrder48S; } else { num_pages = 3; page_order = PageOrder48N; } } loader_table_entry = 0; for( i = 0; i < num_pages; i++ ) { error = add_page( tape, snap, page_order[i].page, page_order[i].address, loader, &loader_table_entry, settings ); if( error ) return error; } error = add_extra_block( tape, snap, page_order, num_pages, loader ); if( error ) return error; /* And finally, put in the checksum for the loader block */ loader[ basic_length + loader_length + 1 ] = calc_checksum( loader, basic_length + loader_length + 1 ); return 0; } static int write_tape( libspectrum_tape *tape, const char *filename ) { libspectrum_byte *buffer; size_t length; int error; length = 0; error = libspectrum_tape_write( &buffer, &length, tape, LIBSPECTRUM_ID_TAPE_TZX ); if( error ) return error; error = write_file( filename, buffer, length ); if( error ) { free( buffer ); return 1; } free( buffer ); return 0; } static int convert_snap( libspectrum_snap *snap, const settings_t *settings ) { libspectrum_tape *tape = libspectrum_tape_alloc(); int error; print_verbose( "\nCreating TZX file:\n" ); error = create_main_header( tape, settings->loader_name ); if( error ) { libspectrum_tape_free( tape ); return error; } error = create_main_data( tape, snap, settings ); if( error ) { libspectrum_tape_free( tape ); return error; } error = write_tape( tape, settings->output_filename ); if( error ) { libspectrum_tape_free( tape ); return error; } libspectrum_tape_free( tape ); return 0; } int main( int argc, char **argv ) { settings_t settings; libspectrum_snap *snap; int error; progname = argv[0]; error = init_libspectrum(); if( error ) return error; error = parse_args( &settings, argc, argv ); if( error ) { fprintf( stderr, "Try `%s --help' for more information.\n", progname ); return error; } error = load_snap( &snap, settings.input_filename ); if( error ) return error; error = convert_snap( snap, &settings ); if( error ) { libspectrum_snap_free( snap ); return error; } libspectrum_snap_free( snap ); print_verbose( "\nDone!\n" ); return 0; } fuse-utils-1.5.1/config.h.in0000664000175000017500000000625115267623710014674 0ustar00fredmfredm/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Define version information for win32 executables */ #undef FUSE_UTILS_RC_VERSION /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the 'fdopen' function. */ #undef HAVE_FDOPEN /* Define to 1 if you have the header file. */ #undef HAVE_GCRYPT_H /* Define if you have the iconv() function and it works. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Defined if we've got audiofile */ #undef HAVE_LIB_AUDIOFILE /* Defined if we've got GLib */ #undef HAVE_LIB_GLIB /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the 'setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the 'signal' function. */ #undef HAVE_SIGNAL /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_ZLIB_H /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Defined if we're going to be using the installed libjpeg */ #undef USE_LIBJPEG /* Defined if we're going to be using the installed libpng */ #undef USE_LIBPNG /* Version number of package */ #undef VERSION /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif fuse-utils-1.5.1/missing0000755000175000017500000001706515267623710014253 0ustar00fredmfredm#! /bin/sh # Common wrapper for a few potentially missing GNU and other programs. scriptversion=2025-06-18.21; # UTC # shellcheck disable=SC2006,SC2268 # we must support pre-POSIX shells # Copyright (C) 1996-2025 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # 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, 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autogen autoheader autom4te automake autoreconf bison flex help2man lex makeinfo perl yacc Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Report bugs to . GNU Automake home page: . General help using GNU software: ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing (GNU Automake) $scriptversion" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake|autoreconf) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; *) : ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" autoheader_deps="'acconfig.h'" automake_deps="'Makefile.am'" aclocal_deps="'acinclude.m4'" case $normalized_program in aclocal*) echo "You should only need it if you modified $aclocal_deps or" echo "$configure_deps." ;; autoconf*) echo "You should only need it if you modified $configure_deps." ;; autogen*) echo "You should only need it if you modified a '.def' or '.tpl' file." echo "You may want to install the GNU AutoGen package:" echo "<$gnu_software_URL/autogen/>" ;; autoheader*) echo "You should only need it if you modified $autoheader_deps or" echo "$configure_deps." ;; automake*) echo "You should only need it if you modified $automake_deps or" echo "$configure_deps." ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." ;; autoreconf*) echo "You should only need it if you modified $aclocal_deps or" echo "$automake_deps or $autoheader_deps or $automake_deps or" echo "$configure_deps." ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; perl*) echo "You should only need it to run GNU Autoconf, GNU Automake, " echo " assorted other tools, or if you modified a Perl source file." echo "You may want to install the Perl 5 language interpreter:" echo "<$perl_URL>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac program_details "$normalized_program" } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" # time-stamp-format: "%Y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: fuse-utils-1.5.1/rzxtool_res.rc0000664000175000017500000000362315157611610015563 0ustar00fredmfredm/* rzxtool_res.rc: resources for Windows executable Copyright (c) 2015 Sergio Baldovi 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. Author contact information: E-mail: serbalgi@gmail.com */ #include "config.h" #include /* VERSIONINFO specs: http://msdn.microsoft.com/en-us/library/aa381058%28VS.85%29.aspx */ VS_VERSION_INFO VERSIONINFO FILEVERSION FUSE_UTILS_RC_VERSION PRODUCTVERSION FUSE_UTILS_RC_VERSION FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0x0L FILEOS VOS__WINDOWS32 FILETYPE VFT_APP FILESUBTYPE VFT2_UNKNOWN BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904B0" BEGIN VALUE "CompanyName", "\0" VALUE "FileDescription", "Modify ZX Spectrum RZX files\0" VALUE "FileVersion", VERSION##"\0" VALUE "InternalName", "rzxtool\0" VALUE "LegalCopyright", "Copyright (c) 2007-2014 Philip Kendall\0" VALUE "License", "rzxtool is licensed under the GNU General Public License, version 2 or later\0" VALUE "OriginalFilename", "rzxtool.exe\0" VALUE "ProductName", PACKAGE##"\0" VALUE "ProductVersion", VERSION##"\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1252 END END fuse-utils-1.5.1/fmfconv.h0000664000175000017500000001123315157611610014446 0ustar00fredmfredm/* fmfconv.h: Convert .fmf movie files Copyright (c) 2004-2015 Gergely Szasz 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. Author contact information: E-mail: szaszg@hu.inter.net */ #ifndef FMFCONV_H #define FMFCONV_H #include "libspectrum.h" #include "fmfconv_types.h" #define FMFCONV_VER_MAJOR 0 #define FMFCONV_VER_MINOR 5 #define FMFCONV_RC_VERSION FMFCONV_VER_MAJOR,FMFCONV_VER_MINOR,0,0 #define __FMFCONV_VER_STRING(maj, min) #maj "." #min #define _FMFCONV_VER_STRING(maj, min) __FMFCONV_VER_STRING( maj, min ) #define FMFCONV_VER_STRING _FMFCONV_VER_STRING( FMFCONV_VER_MAJOR, FMFCONV_VER_MINOR ) #ifdef HAVE_INTTYPES_H #include #else #define PRIu64 "llu" #endif /* #ifdef HAVE_INTTYPES_H */ #ifdef HAVE_ZLIB_H #define USE_ZLIB #endif #define printe(format...) \ fprintf (stderr, "*ERR " format) #define printw(format...) \ fprintf (stderr, "*WRN " format) #define printi(lvl,format...) \ if( lvl <= verbose ) fprintf( stderr, "*INF " format ) enum { ERR_OPEN_INP = 1, ERR_OPEN_OUT, ERR_OPEN_SND, ERR_CORRUPT_INP, ERR_VERSION_INP, ERR_NO_ZLIB, ERR_ENDOFFILE, ERR_OUTOFMEM, ERR_CORRUPT_SND, ERR_BAD_PARAM, ERR_WRITE_OUT, ERR_WRITE_SND, }; typedef enum { TYPE_UNSET = -1, TYPE_NONE = 0, TYPE_FMF, /* i */ TYPE_SCR, /* io (no conv) */ TYPE_PPM, /* o (conv to RGB) */ TYPE_PNG, TYPE_JPEG, TYPE_MJPEG, /* o */ TYPE_AVI, /* os */ TYPE_YUV, /* o (conv to YUV) */ TYPE_FFMPEG, /* os */ TYPE_WAV, /* s */ TYPE_AU, /* s */ TYPE_AIFF, /* s */ TYPE_444, TYPE_422, TYPE_420J, TYPE_420M, TYPE_420, TYPE_410, TYPE_mono, TYPE_AVI_DIB, TYPE_RESCALE_WH, TYPE_RESCALE_X, TYPE_PERC, TYPE_BAR, TYPE_FRAME, TYPE_TIME, TYPE_NOCUT, TYPE_CUTFROM, TYPE_CUT, } type_t; extern int verbose; extern FILE *out, *snd; extern int out_to_stdout; extern int frm_slice_x, frm_slice_y, frm_slice_w, frm_slice_h; extern int frm_w, frm_h; extern int frm_fps; extern fmf_machine_type frm_mch; extern libspectrum_qword output_no; /* output frame no */ extern type_t yuv_t, out_t, snd_t; extern fmf_screen_type scr_t; extern const char *out_name; extern int out_w, out_h; extern int out_fps; /* desired output frame rate */ extern int out_header_ok; /* output header ok? */ extern int out_chn, out_rte, out_fsz, out_len; extern libspectrum_signed_byte *sound8; /* sound buffer for x-law */ extern libspectrum_signed_word *sound16; /* sound buffer for pcm */ extern fmf_sound_type snd_enc; /* sound type (pcm/alaw/ulaw) */ extern int snd_rte, snd_chn, snd_fsz, snd_len; /* sound rate (Hz), sound channels (1/2), sound length in byte */ extern int snd_header_ok; /* sound header ok? */ extern int snd_little_endian; extern libspectrum_byte zxscr[]; /* 2x 40x240 bitmap1 bitmap2 */ extern libspectrum_byte attrs[]; /* 40x240 attrib */ extern libspectrum_byte pix_rgb[]; /* other view of data */ extern libspectrum_byte *pix_yuv[]; /* other view of data */ extern int yuv_ylen, yuv_uvlen; extern int machine_timing[]; extern int force_aifc; /* record aifc file even PCM sound */ FILE *fopen_overwr( const char *path, const char *mode, int rw ); libspectrum_dword swap_endian_dword( libspectrum_dword d ); void pcm_swap_endian( void ); /* buff == sound */ int next_outname( libspectrum_qword num ); int close_out( void ); int open_out( void ); int snd_write_avi( void ); int out_write_avi( void ); void out_finalize_avi( void ); int out_write_yuv( void ); int out_write_scr( void ); int out_write_ppm( void ); #ifdef USE_LIBPNG int out_write_png( void ); void print_png_version( void ); #endif #ifdef USE_LIBJPEG int out_write_jpg( void ); int out_write_mjpeg( void ); int out_build_avi_mjpeg_frame( char **frame_buff, unsigned long int *frame_size ); void out_finalize_mjpeg( void ); void print_jpeg_version( void ); #endif int snd_write_wav( void ); void snd_finalize_wav( void ); int snd_write_au( void ); void snd_finalize_au( void ); int snd_write_aiff( void ); void snd_finalize_aiff( void ); #endif /* FMFCONV_H */ fuse-utils-1.5.1/tape2pulses.c0000664000175000017500000001167315253737163015273 0ustar00fredmfredm/* tape2pulses.c: Dump pulses in tape files (tzx, tap, etc.) to text Copyright (c) 2016 Fredrick Meunier 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. Author contact information: E-mail: fredm@spamcop.net */ #include "config.h" #include #include #include #include #include #include "libspectrum.h" #include "utils.h" #define PROGRAM_NAME "tape2pulses" static void show_help( void ); static void show_version( void ); static int read_tape( char *filename, libspectrum_tape **tape ); static int write_pulses( char *filename, libspectrum_tape *tape ); char *progname; int main( int argc, char **argv ) { int c, error = 0; libspectrum_tape *tzx; progname = argv[0]; struct option long_options[] = { { "help", 0, NULL, 'h' }, { "version", 0, NULL, 'V' }, { 0, 0, 0, 0 } }; while( ( c = getopt_long( argc, argv, "hV", long_options, NULL ) ) != -1 ) { switch( c ) { case 'h': show_help(); return 0; case 'V': show_version(); return 0; case '?': /* getopt prints an error message to stderr */ error = 1; break; default: error = 1; fprintf( stderr, "%s: unknown option `%c'\n", progname, (char) c ); break; } } argc -= optind; argv += optind; if( error ) { fprintf( stderr, "Try `%s --help' for more information.\n", progname ); return error; } if( argc < 2 ) { fprintf( stderr, "%s: usage: %s \n", progname, progname ); fprintf( stderr, "Try `%s --help' for more information.\n", progname ); return 1; } error = init_libspectrum(); if( error ) return error; if( read_tape( argv[0], &tzx ) ) return 1; if( write_pulses( argv[1], tzx ) ) { libspectrum_tape_free( tzx ); return 1; } libspectrum_tape_free( tzx ); return 0; } static void show_version( void ) { printf( PROGRAM_NAME " (" PACKAGE ") " PACKAGE_VERSION "\n" "Copyright (c) 2016 Fredrick Meunier\n" "License GPLv2+: GNU GPL version 2 or later " "\n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" ); } static void show_help( void ) { printf( "Usage: %s [OPTION] \n" "Dumps the pulse information from ZX Spectrum tape images to text files.\n" "\n" "Options:\n" " -h, --help Display this help and exit.\n" " -V, --version Output version information and exit.\n" "\n" "Report %s bugs to <%s>\n" "%s home page: <%s>\n" "For complete documentation, see the manual page of %s.\n", progname, PROGRAM_NAME, PACKAGE_BUGREPORT, PACKAGE_NAME, PACKAGE_URL, PROGRAM_NAME ); } static int read_tape( char *filename, libspectrum_tape **tape ) { libspectrum_file file; if( read_file( filename, &file ) ) return 1; *tape = libspectrum_tape_alloc(); if( libspectrum_tape_read( *tape, file.buffer, file.length, file.type, file.filename ) ) { libspectrum_file_clear( &file ); return 1; } libspectrum_file_clear( &file ); return 0; } static int write_pulses( char *filename, libspectrum_tape *tape ) { libspectrum_error error; short level = 0; /* The last level output to this block */ libspectrum_tape_edge edge = { 0 }; libspectrum_dword balance_tstates = 0; FILE *output_file; if( strncmp( filename, "-", 1 ) == 0 ) { output_file = stdout; } else { output_file = fopen(filename, "w"); if(output_file == NULL) { fprintf( stderr, "%s: error opening pulse file for writing: %s\n", progname, strerror(errno) ); return 1; } } while( !(edge.flags & LIBSPECTRUM_TAPE_FLAGS_TAPE) ) { error = libspectrum_tape_get_next_edge( &edge, tape ); if( error != LIBSPECTRUM_ERROR_NONE ) { fclose( output_file ); return 1; } level = edge.level; balance_tstates += edge.tstates; if( edge.transition == LIBSPECTRUM_TAPE_TRANSITION_NONE ) continue; fprintf(output_file, "%u : %d\n", balance_tstates, level); balance_tstates = 0; } if( fclose(output_file) == EOF ) { fprintf( stderr, "%s: error closing pulse file: %s\n", progname, strerror(errno) ); return 1; } return 0; } fuse-utils-1.5.1/listbasic.c0000664000175000017500000004353215253737163015000 0ustar00fredmfredm/* listbasic.c: extract the BASIC listing from a snapshot or tape file Copyright (c) 2002 Chris Cowley 2003 Philip Kendall, Darren Salt 2007 Stuart Brady Copyright (c) 2015 Sergio Baldovi 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. Author contact information: Philip: philip-fuse@shadowmagic.org.uk Chris: ccowley@grok.co.uk */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "libspectrum.h" #include "utils.h" #define PROGRAM_NAME "listbasic" /* argv[0] */ char *progname; int betabasic = 0; /* A function used to read memory */ typedef libspectrum_byte (*memory_read_fn)( libspectrum_word offset, void *data ); static void show_help( void ); static void show_version( void ); int parse_snapshot_file( const unsigned char *buffer, size_t length, libspectrum_id_t type ); libspectrum_byte read_snap_memory( libspectrum_word address, void *data ); int parse_tape_file( const unsigned char *buffer, size_t length, libspectrum_id_t type ); libspectrum_byte read_tape_block( libspectrum_word offset, void *data ); int parse_microdrive_file( unsigned char *buffer, size_t length ); libspectrum_byte read_microdrive_program( libspectrum_word offset, void *data ); int extract_basic( libspectrum_word offset, libspectrum_word end, memory_read_fn get_byte, void *data ); int detokenize( libspectrum_word offset, int length, memory_read_fn get_byte, void *data ); int main(int argc, char* argv[]) { libspectrum_file file; int c; int error = 0; struct option long_options[] = { { "help", 0, NULL, 'h' }, { "version", 0, NULL, 'V' }, { 0, 0, 0, 0 } }; progname = argv[0]; while( ( c = getopt_long( argc, argv, "bhV", long_options, NULL ) ) != -1 ) { switch( c ) { case 'b': betabasic = 1; break; case 'h': show_help(); return 0; case 'V': show_version(); return 0; case '?': /* getopt prints an error message to stderr */ error = 1; break; default: error = 1; fprintf( stderr, "%s: unknown option `%c'\n", progname, (char) c ); break; } } argc -= optind; argv += optind; if( error ) { fprintf( stderr, "Try `%s --help' for more information.\n", progname ); return error; } if( argc != 1 ) { fprintf( stderr, "%s: usage: %s [-b] \n", progname, progname ); fprintf( stderr, "Try `%s --help' for more information.\n", progname ); return 1; } error = init_libspectrum(); if( error ) return error; error = read_file( argv[0], &file ); if( error ) return error; switch( file.file_class ) { case LIBSPECTRUM_CLASS_SNAPSHOT: error = parse_snapshot_file( file.buffer, file.length, file.type ); if( error ) { libspectrum_file_clear( &file ); return error; } break; case LIBSPECTRUM_CLASS_TAPE: error = parse_tape_file( file.buffer, file.length, file.type ); if( error ) { libspectrum_file_clear( &file ); return error; } break; case LIBSPECTRUM_CLASS_MICRODRIVE: error = parse_microdrive_file( file.buffer, file.length ); if( error ) { libspectrum_file_clear( &file ); return error; } break; case LIBSPECTRUM_CLASS_UNKNOWN: fprintf( stderr, "%s: couldn't identify the file type of `%s'\n", progname, argv[0] ); libspectrum_file_clear( &file ); return 1; default: fprintf( stderr, "%s: `%s' is an unsupported file type\n", progname, argv[0] ); libspectrum_file_clear( &file ); return 1; } libspectrum_file_clear( &file ); return 0; } static void show_version( void ) { printf( PROGRAM_NAME " (" PACKAGE ") " PACKAGE_VERSION "\n" "Copyright (c) 2002 Chris Cowley\n" "Copyright (c) 2003 Philip Kendall, Darren Salt\n" "Copyright (c) 2007 Stuart Brady\n" "License GPLv2+: GNU GPL version 2 or later " "\n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" ); } static void show_help( void ) { printf( "Usage: %s [OPTION] \n" "Extracts BASIC listings from ZX Spectrum snapshots, tapes or Microdrive cartridges.\n" "\n" "Options:\n" " -b Specifies that the program to list is a Beta BASIC program.\n" " -h, --help Display this help and exit.\n" " -V, --version Output version information and exit.\n" "\n" "Report %s bugs to <%s>\n" "%s home page: <%s>\n" "For complete documentation, see the manual page of %s.\n", progname, PROGRAM_NAME, PACKAGE_BUGREPORT, PACKAGE_NAME, PACKAGE_URL, PROGRAM_NAME ); } int parse_snapshot_file( const unsigned char *buffer, size_t length, libspectrum_id_t type ) { libspectrum_snap *snap = libspectrum_snap_alloc(); libspectrum_word program_address; int error; error = libspectrum_snap_read( snap, buffer, length, type, NULL ); if( error ) { libspectrum_snap_free( snap ); return error; } program_address = read_snap_memory( 23635, snap ) | read_snap_memory( 23636, snap ) << 8; if( program_address < 23296 || program_address > 65530 ) { fprintf( stderr, "%s: invalid program start address 0x%04x\n", progname, program_address ); libspectrum_snap_free( snap ); return 1; } error = extract_basic( program_address, 0, read_snap_memory, snap ); if( error ) { libspectrum_snap_free( snap ); return error; } error = libspectrum_snap_free( snap ); if( error ) return error; return 0; } libspectrum_byte read_snap_memory( libspectrum_word address, void *data ) { libspectrum_snap *snap = data; /* FIXME: assumes a 48K memory model */ switch( address >> 14 ) { case 0: /* ROM; can't handle this */ fprintf( stderr, "%s: attempt to read from ROM\n", progname ); /* FIXME: find a better way to handle the error return */ exit( 1 ); case 1: return libspectrum_snap_pages( snap, 5 )[ address & 0x3fff ]; case 2: return libspectrum_snap_pages( snap, 2 )[ address & 0x3fff ]; case 3: return libspectrum_snap_pages( snap, 0 )[ address & 0x3fff ]; default: /* Should never happen */ fprintf( stderr, "%s: attempt to read from address %x\n", progname, address ); abort(); } } int parse_tape_file( const unsigned char *buffer, size_t length, libspectrum_id_t type ) { libspectrum_tape *tape = libspectrum_tape_alloc(); libspectrum_tape_iterator iterator; libspectrum_tape_block *tape_block; libspectrum_byte *data; libspectrum_word program_length; int error; error = libspectrum_tape_read( tape, buffer, length, type, NULL ); if( error ) { libspectrum_tape_free( tape ); return error; } for( tape_block = libspectrum_tape_iterator_init( &iterator, tape ); tape_block; tape_block = libspectrum_tape_iterator_next( &iterator ) ) { /* Find a ROM block */ if( libspectrum_tape_block_type( tape_block ) != LIBSPECTRUM_TAPE_BLOCK_ROM ) continue; /* Start assuming this block is a BASIC header; firstly, check there is another block after this one to hold the data, and if there's not, just finish */ if( !libspectrum_tape_iterator_peek_next( iterator ) ) break; /* If it's a header, it must be 19 bytes long */ if( libspectrum_tape_block_data_length( tape_block ) != 19 ) continue; data = libspectrum_tape_block_data( tape_block ); /* The first byte should be zero to indicate a header */ if( data[0] != 0 ) continue; /* The second byte should be zero to indicate a BASIC program */ if( data[1] != 0 ) continue; /* The program length is stored at offset 16 */ program_length = data[16] | data[17] << 8; /* Now have a look at the next block */ tape_block = libspectrum_tape_iterator_peek_next( iterator ); /* Must be a ROM block */ if( libspectrum_tape_block_type( tape_block ) != LIBSPECTRUM_TAPE_BLOCK_ROM ) continue; /* Must be at least as long as the program */ if( libspectrum_tape_block_data_length( tape_block ) < program_length ) continue; data = libspectrum_tape_block_data( tape_block ); /* Must be a data block */ if( data[0] != 0xff ) continue; /* Now, just read the BASIC out */ error = extract_basic( 1, program_length + 1, read_tape_block, tape_block ); if( error ) { libspectrum_tape_free( tape ); return error; } /* Don't parse this block again */ libspectrum_tape_iterator_next( &iterator ); } error = libspectrum_tape_free( tape ); if( error ) return error; return 0; } libspectrum_byte read_tape_block( libspectrum_word offset, void *data ) { libspectrum_tape_block *tape_block = data; if( offset > libspectrum_tape_block_data_length( tape_block ) ) { fprintf( stderr, "%s: attempt to read past end of block\n", progname ); exit( 1 ); } return libspectrum_tape_block_data( tape_block )[offset]; } libspectrum_byte read_microdrive_program( libspectrum_word offset, void *data ) { return ( (libspectrum_byte*)data )[offset]; } int parse_microdrive_file( unsigned char *buffer, size_t length ) { libspectrum_microdrive *microdrive = libspectrum_microdrive_alloc(); microdrive_file *files; size_t count, i; int error; if( !microdrive ) return 1; error = libspectrum_microdrive_mdr_read( microdrive, buffer, length ); if( error ) { libspectrum_microdrive_free( microdrive ); return error; } if( get_microdrive_files( microdrive, &files, &count ) ) { libspectrum_microdrive_free( microdrive ); return 1; } for( i = 0; i < count; i++ ) { microdrive_file_header header; char name_utf8[ MICRODRIVE_FILE_NAME_LENGTH * 9 + 1 ]; if( !( files[i].flags & LIBSPECTRUM_MICRODRIVE_RECORD_NON_PRINT ) || decode_microdrive_file_header( &header, files[i].data, files[i].data_length ) || header.type != 0 || !header.length || header.parameter2 > header.length || header.length > 65526 || files[i].data_length < (size_t)header.length + MICRODRIVE_FILE_HEADER_LENGTH ) continue; if( !libspectrum_zx_string_to_utf8( name_utf8, sizeof( name_utf8 ), files[i].name, MICRODRIVE_FILE_NAME_LENGTH ) ) printf( "Program: \"%s\"\n", name_utf8 ); error = extract_basic( MICRODRIVE_FILE_HEADER_LENGTH, MICRODRIVE_FILE_HEADER_LENGTH + header.parameter2, read_microdrive_program, files[i].data ); if( error ) { free_microdrive_files( files, count ); libspectrum_microdrive_free( microdrive ); return error; } printf( "\n" ); } free_microdrive_files( files, count ); error = libspectrum_microdrive_free( microdrive ); return error; } int extract_basic( libspectrum_word offset, libspectrum_word end, memory_read_fn get_byte, void *data ) { int line_number, line_length; int error; while( !end || offset < end ) { line_number = get_byte( offset, data ) << 8 | get_byte( offset + 1, data ); offset += 2; if( line_number >= 16384 ) break; line_length = get_byte( offset, data ) | get_byte( offset + 1, data ) << 8; offset += 2; /* Hide line 0 for Beta BASIC */ if( line_number != 0 || !betabasic ) { printf( "%5d", line_number ); if( betabasic ) putchar( ' ' ); error = detokenize( offset, line_length, get_byte, data ); if( error ) return error; printf( "\n" ); } offset += line_length; } return 0; } static char print_keyword( const char *keyword, char space ) { char last_char; if( !space && keyword[0] == ' ' ) { printf( "%s", keyword + 1 ); } else { printf( "%s", keyword ); } last_char = keyword[ strlen( keyword ) - 1 ]; return( last_char != ' ' ); } int detokenize( libspectrum_word offset, int length, memory_read_fn get_byte, void *data ) { int i; libspectrum_byte b; char keyword_next = 1, quote = 0, rem = 0; char space; char first; /* set for the first token in each statement */ char nextfirst = 1; static const char keyword[][12] = { " SPECTRUM ", " PLAY ", "RND", "INKEY$", "PI", "FN ", "POINT ", "SCREEN$ ", "ATTR ", "AT ", "TAB ", "VAL$ ", "CODE ", "VAL ", "LEN ", "SIN ", "COS ", "TAN ", "ASN ", "ACS ", "ATN ", "LN ", "EXP ", "INT ", "SQR ", "SGN ", "ABS ", "PEEK ", "IN ", "USR ", "STR$ ", "CHR$ ", "NOT ", "BIN ", " OR ", " AND ", "<=", ">=", "<>", " LINE ", " THEN ", " TO ", " STEP ", " DEF FN ", " CAT ", " FORMAT ", " MOVE ", " ERASE ", " OPEN #", " CLOSE #", " MERGE ", " VERIFY ", " BEEP ", " CIRCLE ", " INK ", " PAPER ", " FLASH ", " BRIGHT ", " INVERSE ", " OVER ", " OUT ", " LPRINT ", " LLIST ", " STOP ", " READ ", " DATA ", " RESTORE ", " NEW ", " BORDER ", " CONTINUE "," DIM ", " REM ", " FOR ", " GO TO ", " GO SUB ", " INPUT ", " LOAD ", " LIST ", " LET ", " PAUSE ", " NEXT ", " POKE ", " PRINT ", " PLOT ", " RUN ", " SAVE ", " RANDOMIZE ", " IF ", " CLS ", " DRAW ", " CLEAR ", " RETURN ", " COPY " }; /* Beta BASIC keywords: */ static const char beta_keyword[][11] = { " KEYWORDS ", " DEF PROC ", " PROC ", " END PROC ", " RENUM ", " WINDOW ", " AUTO ", " DELETE ", " REF ", " JOIN ", " EDIT ", " KEYIN ", " LOCAL ", " DEFAULT ", " DEF KEY ", " CSIZE ", " ALTER ", " BLANK ", " CLOCK ", " DO ", " ELSE ", " FILL ", " GET ", " ENDIF ", " EXIT IF ", " WHILE ", " UNTIL ", " LOOP ", " SORT ", " ON ERROR ", " ON ", " DPOKE ", " POP ", " ROLL ", " SCROLL ", " TRACE ", " USING ", }; if( betabasic ) space = 0; else space = 1; /* The Timex keywords, DELETE, ON ERR, STICK, SOUND, FREE, RESET, * are handled below */ for( i = 0; i < length; i++ ) { char nextspace = 1; first = nextfirst; nextfirst = 0; b = get_byte( offset + i, data ); if( b < 128 ) { switch( b ) { case 12: if( !keyword_next ) continue; nextspace = print_keyword( " DELETE ", space ); break; case 14: /* Skip encoded number */ i += 5; continue; /* Skip encoded INK, PAPER, FLASH, BRIGHT, INVERSE, OVER */ case 16: case 17: case 18: case 19: case 20: case 21: i++; continue; case 22: case 23: /* Skip encoded AT, TAB */ i += 2; continue; case 32: if( !betabasic || i != 0 ) putchar( b ); nextspace = 0; nextfirst = first; break; case 34: if( !rem ) quote = !quote; putchar( b ); break; case 58: if( !rem && !quote ) keyword_next = 2; nextfirst = 1; putchar( b ); break; case 92: printf( "\\\\" ); break; /* case 96: putchar (0xA3); break; */ case 123: if( keyword_next ) { keyword_next = 2; nextspace = print_keyword( " ON ERR ", space ); } else { putchar( b ); } break; case 124: if( keyword_next ) { nextspace = print_keyword( " STICK ", space ); } else { putchar( b ); } break; case 125: if( keyword_next ) { nextspace = print_keyword( " SOUND ", space ); } else { putchar( b ); } break; case 126: if( keyword_next ) { nextspace = print_keyword (" FREE ", space); } else { putchar( b ); } break; case 127: if( keyword_next ) { nextspace = print_keyword (" RESET ", space); } else { printf( "\\*" ); /* putchar (0xA9); */ } break; default: if( b < 32 ) continue; putchar( b ); break; } } else if( betabasic && b >= 128 && b <= 164 ) { if( b == 164 && first ) { nextspace = print_keyword( keyword[ b - 163 ], space ); } else { nextspace = print_keyword( beta_keyword[ b - 128 ], space ); if( b == 148 ) { /* ELSE */ nextfirst = 1; keyword_next = 2; } } } else if( b < 163 + 2 * quote ) { switch( b ) { case 128: printf( "\\ " ); break; /* Graphics characters */ case 129: printf( "\\ '" ); break; case 130: printf( "\\' " ); break; case 131: printf( "\\''" ); break; case 132: printf( "\\ ." ); break; case 133: printf( "\\ :" ); break; case 134: printf( "\\'." ); break; case 135: printf( "\\':" ); break; case 136: printf( "\\. " ); break; case 137: printf( "\\.'" ); break; case 138: printf( "\\: " ); break; case 139: printf( "\\:'" ); break; case 140: printf( "\\.." ); break; case 141: printf( "\\.:" ); break; case 142: printf( "\\:." ); break; case 143: printf( "\\::" ); break; default: printf( "\\%c", b - 144 + 'a' ); break; /* UDGs */ } } else { nextspace = print_keyword( keyword[ b - 163 ], space ); } space = nextspace; switch (b) { case 203: nextfirst = 1; keyword_next = 1; break; /* THEN */ case 234: nextfirst = 1; rem = 1; break; /* REM */ default: if( keyword_next ) keyword_next--; break; } } return 0; } fuse-utils-1.5.1/scl2trd_res.rc0000664000175000017500000000367415157611610015425 0ustar00fredmfredm/* scl2trd_res.rc: resources for Windows executable Copyright (c) 2015 Sergio Baldovi 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. Author contact information: E-mail: serbalgi@gmail.com */ #include "config.h" #include /* VERSIONINFO specs: http://msdn.microsoft.com/en-us/library/aa381058%28VS.85%29.aspx */ VS_VERSION_INFO VERSIONINFO FILEVERSION FUSE_UTILS_RC_VERSION PRODUCTVERSION FUSE_UTILS_RC_VERSION FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0x0L FILEOS VOS__WINDOWS32 FILETYPE VFT_APP FILESUBTYPE VFT2_UNKNOWN BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904B0" BEGIN VALUE "CompanyName", "\0" VALUE "FileDescription", "Convert .scl disk images to .trd\0" VALUE "FileVersion", VERSION##"\0" VALUE "InternalName", "scl2trd\0" VALUE "LegalCopyright", "Copyright (c) 2002-2007 Dmitry Sanarin, Philip Kendall and Fredrick Meunier\0" VALUE "License", "scl2trd is licensed under the GNU General Public License, version 2 or later\0" VALUE "OriginalFilename", "scl2trd.exe\0" VALUE "ProductName", PACKAGE##"\0" VALUE "ProductVersion", VERSION##"\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1252 END END fuse-utils-1.5.1/Makefile.in0000664000175000017500000027743115267623710014730 0ustar00fredmfredm# Makefile.in generated by automake 1.18.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2025 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = createhdf$(EXEEXT) fmfconv$(EXEEXT) listbasic$(EXEEXT) \ mdrlist$(EXEEXT) profile2map$(EXEEXT) raw2hdf$(EXEEXT) \ rzxdump$(EXEEXT) rzxtool$(EXEEXT) scl2trd$(EXEEXT) \ snap2tzx$(EXEEXT) snapconv$(EXEEXT) snapdump$(EXEEXT) \ tape2wav$(EXEEXT) tapeconv$(EXEEXT) tape2pulses$(EXEEXT) \ tzxlist$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) @BUILD_AUDIOTOOLS_TRUE@am__append_1 = audio2tape @BUILD_RZXCHECK_TRUE@am__append_2 = rzxcheck EXTRA_PROGRAMS = rzxcheck$(EXEEXT) audio2tape$(EXEEXT) @COMPAT_GETOPT_TRUE@am__append_3 = compat/getopt.c compat/getopt1.c @HAVE_LIBJPEG_TRUE@am__append_4 = fmfconv_output/fmfconv_jpg.c @HAVE_LIBPNG_TRUE@am__append_5 = fmfconv_output/fmfconv_png.c @COMPAT_AMIGA_TRUE@am__append_6 = \ @COMPAT_AMIGA_TRUE@ compat/amiga/basename.c \ @COMPAT_AMIGA_TRUE@ compat/amiga/osname.c @COMPAT_UNIX_TRUE@am__append_7 = \ @COMPAT_UNIX_TRUE@ compat/unix/basename.c \ @COMPAT_UNIX_TRUE@ compat/unix/osname.c @COMPAT_WIN32_TRUE@am__append_8 = \ @COMPAT_WIN32_TRUE@ compat/unix/basename.c \ @COMPAT_WIN32_TRUE@ compat/win32/osname.c @HAVE_WINDRES_TRUE@am__append_9 = audio2tape_res.rc @HAVE_WINDRES_TRUE@am__append_10 = createhdf_res.rc @HAVE_WINDRES_TRUE@am__append_11 = fmfconv_res.rc @HAVE_WINDRES_TRUE@am__append_12 = listbasic_res.rc @HAVE_WINDRES_TRUE@am__append_13 = mdrlist_res.rc @HAVE_WINDRES_TRUE@am__append_14 = profile2map_res.rc @HAVE_WINDRES_TRUE@am__append_15 = raw2hdf_res.rc @HAVE_WINDRES_TRUE@am__append_16 = rzxcheck_res.rc @HAVE_WINDRES_TRUE@am__append_17 = rzxdump_res.rc @HAVE_WINDRES_TRUE@am__append_18 = rzxtool_res.rc @HAVE_WINDRES_TRUE@am__append_19 = scl2trd_res.rc @HAVE_WINDRES_TRUE@am__append_20 = snap2tzx_res.rc @HAVE_WINDRES_TRUE@am__append_21 = snapconv_res.rc @HAVE_WINDRES_TRUE@am__append_22 = snapdump_res.rc @HAVE_WINDRES_TRUE@am__append_23 = tape2pulses_res.rc @HAVE_WINDRES_TRUE@am__append_24 = tape2wav_res.rc @HAVE_WINDRES_TRUE@am__append_25 = tapeconv_res.rc @HAVE_WINDRES_TRUE@am__append_26 = tzxlist_res.rc subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/audiofile.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(noinst_HEADERS) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = fuse-utils.qpg CONFIG_CLEAN_VPATH_FILES = @BUILD_AUDIOTOOLS_TRUE@am__EXEEXT_1 = audio2tape$(EXEEXT) @BUILD_RZXCHECK_TRUE@am__EXEEXT_2 = rzxcheck$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cr AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = compat_libcompatos_a_AR = $(AR) $(ARFLAGS) compat_libcompatos_a_RANLIB = $(RANLIB) compat_libcompatos_a_LIBADD = am__compat_libcompatos_a_SOURCES_DIST = compat/amiga/basename.c \ compat/amiga/osname.c compat/unix/basename.c \ compat/unix/osname.c compat/win32/osname.c am__dirstamp = $(am__leading_dot)dirstamp @COMPAT_AMIGA_TRUE@am__objects_1 = compat/amiga/basename.$(OBJEXT) \ @COMPAT_AMIGA_TRUE@ compat/amiga/osname.$(OBJEXT) @COMPAT_UNIX_TRUE@am__objects_2 = compat/unix/basename.$(OBJEXT) \ @COMPAT_UNIX_TRUE@ compat/unix/osname.$(OBJEXT) @COMPAT_WIN32_TRUE@am__objects_3 = compat/unix/basename.$(OBJEXT) \ @COMPAT_WIN32_TRUE@ compat/win32/osname.$(OBJEXT) am_compat_libcompatos_a_OBJECTS = $(am__objects_1) $(am__objects_2) \ $(am__objects_3) compat_libcompatos_a_OBJECTS = $(am_compat_libcompatos_a_OBJECTS) am__audio2tape_SOURCES_DIST = audio2tape.cc importer/soundfile.cc \ importer/trigger.cc converter/findpilot.cc \ converter/findsync1.cc converter/getpulse1.cc \ converter/getpulse2.cc converter/getsync2.cc \ converter/romloader.cc converter/romloaderstate.cc utils.c \ audio2tape_res.rc @HAVE_WINDRES_TRUE@am__objects_4 = audio2tape_res.$(OBJEXT) am_audio2tape_OBJECTS = audio2tape-audio2tape.$(OBJEXT) \ importer/audio2tape-soundfile.$(OBJEXT) \ importer/audio2tape-trigger.$(OBJEXT) \ converter/audio2tape-findpilot.$(OBJEXT) \ converter/audio2tape-findsync1.$(OBJEXT) \ converter/audio2tape-getpulse1.$(OBJEXT) \ converter/audio2tape-getpulse2.$(OBJEXT) \ converter/audio2tape-getsync2.$(OBJEXT) \ converter/audio2tape-romloader.$(OBJEXT) \ converter/audio2tape-romloaderstate.$(OBJEXT) \ audio2tape-utils.$(OBJEXT) $(am__objects_4) audio2tape_OBJECTS = $(am_audio2tape_OBJECTS) am__DEPENDENCIES_1 = audio2tape_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ compat/libcompatos.a AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am__createhdf_SOURCES_DIST = ide.c createhdf.c createhdf_res.rc @HAVE_WINDRES_TRUE@am__objects_5 = createhdf_res.$(OBJEXT) am_createhdf_OBJECTS = ide.$(OBJEXT) createhdf.$(OBJEXT) \ $(am__objects_5) createhdf_OBJECTS = $(am_createhdf_OBJECTS) createhdf_LDADD = $(LDADD) am__fmfconv_SOURCES_DIST = fmfconv.c fmfconv_compr.c fmfconv_types.c \ fmfconv_output/fmfconv_aiff.c fmfconv_output/fmfconv_au.c \ fmfconv_output/fmfconv_avi.c fmfconv_output/fmfconv_ppm.c \ fmfconv_output/fmfconv_scr.c fmfconv_output/fmfconv_wav.c \ fmfconv_output/fmfconv_yuv.c compat/getopt.c compat/getopt1.c \ fmfconv_output/fmfconv_jpg.c fmfconv_output/fmfconv_png.c \ fmfconv_res.rc @COMPAT_GETOPT_TRUE@am__objects_6 = compat/getopt.$(OBJEXT) \ @COMPAT_GETOPT_TRUE@ compat/getopt1.$(OBJEXT) @HAVE_LIBJPEG_TRUE@am__objects_7 = \ @HAVE_LIBJPEG_TRUE@ fmfconv_output/fmfconv_jpg.$(OBJEXT) @HAVE_LIBPNG_TRUE@am__objects_8 = \ @HAVE_LIBPNG_TRUE@ fmfconv_output/fmfconv_png.$(OBJEXT) @HAVE_WINDRES_TRUE@am__objects_9 = fmfconv_res.$(OBJEXT) am_fmfconv_OBJECTS = fmfconv.$(OBJEXT) fmfconv_compr.$(OBJEXT) \ fmfconv_types.$(OBJEXT) fmfconv_output/fmfconv_aiff.$(OBJEXT) \ fmfconv_output/fmfconv_au.$(OBJEXT) \ fmfconv_output/fmfconv_avi.$(OBJEXT) \ fmfconv_output/fmfconv_ppm.$(OBJEXT) \ fmfconv_output/fmfconv_scr.$(OBJEXT) \ fmfconv_output/fmfconv_wav.$(OBJEXT) \ fmfconv_output/fmfconv_yuv.$(OBJEXT) $(am__objects_6) \ $(am__objects_7) $(am__objects_8) $(am__objects_9) fmfconv_OBJECTS = $(am_fmfconv_OBJECTS) fmfconv_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ compat/libcompatos.a am__listbasic_SOURCES_DIST = listbasic.c utils.c listbasic_res.rc @HAVE_WINDRES_TRUE@am__objects_10 = listbasic_res.$(OBJEXT) am_listbasic_OBJECTS = listbasic.$(OBJEXT) utils.$(OBJEXT) \ $(am__objects_10) listbasic_OBJECTS = $(am_listbasic_OBJECTS) listbasic_DEPENDENCIES = $(am__DEPENDENCIES_1) compat/libcompatos.a am__mdrlist_SOURCES_DIST = mdrlist.c utils.c mdrlist_res.rc @HAVE_WINDRES_TRUE@am__objects_11 = mdrlist_res.$(OBJEXT) am_mdrlist_OBJECTS = mdrlist.$(OBJEXT) utils.$(OBJEXT) \ $(am__objects_11) mdrlist_OBJECTS = $(am_mdrlist_OBJECTS) mdrlist_DEPENDENCIES = $(am__DEPENDENCIES_1) compat/libcompatos.a am__profile2map_SOURCES_DIST = profile2map.c utils.c \ profile2map_res.rc @HAVE_WINDRES_TRUE@am__objects_12 = profile2map_res.$(OBJEXT) am_profile2map_OBJECTS = profile2map.$(OBJEXT) utils.$(OBJEXT) \ $(am__objects_12) profile2map_OBJECTS = $(am_profile2map_OBJECTS) profile2map_DEPENDENCIES = $(am__DEPENDENCIES_1) compat/libcompatos.a am__raw2hdf_SOURCES_DIST = ide.c raw2hdf.c raw2hdf_res.rc @HAVE_WINDRES_TRUE@am__objects_13 = raw2hdf_res.$(OBJEXT) am_raw2hdf_OBJECTS = ide.$(OBJEXT) raw2hdf.$(OBJEXT) $(am__objects_13) raw2hdf_OBJECTS = $(am_raw2hdf_OBJECTS) raw2hdf_LDADD = $(LDADD) am__rzxcheck_SOURCES_DIST = rzxcheck.c keys.c utils.c rzxcheck_res.rc @HAVE_WINDRES_TRUE@am__objects_14 = rzxcheck_res.$(OBJEXT) am_rzxcheck_OBJECTS = rzxcheck.$(OBJEXT) keys.$(OBJEXT) \ utils.$(OBJEXT) $(am__objects_14) rzxcheck_OBJECTS = $(am_rzxcheck_OBJECTS) rzxcheck_DEPENDENCIES = $(am__DEPENDENCIES_1) compat/libcompatos.a am__rzxdump_SOURCES_DIST = rzxdump.c utils.c rzxdump_res.rc @HAVE_WINDRES_TRUE@am__objects_15 = rzxdump_res.$(OBJEXT) am_rzxdump_OBJECTS = rzxdump.$(OBJEXT) utils.$(OBJEXT) \ $(am__objects_15) rzxdump_OBJECTS = $(am_rzxdump_OBJECTS) rzxdump_DEPENDENCIES = $(am__DEPENDENCIES_1) compat/libcompatos.a am__rzxtool_SOURCES_DIST = rzxtool.c utils.c rzxtool_res.rc @HAVE_WINDRES_TRUE@am__objects_16 = rzxtool_res.$(OBJEXT) am_rzxtool_OBJECTS = rzxtool.$(OBJEXT) utils.$(OBJEXT) \ $(am__objects_16) rzxtool_OBJECTS = $(am_rzxtool_OBJECTS) rzxtool_DEPENDENCIES = $(am__DEPENDENCIES_1) compat/libcompatos.a am__scl2trd_SOURCES_DIST = scl2trd.c scl2trd_res.rc @HAVE_WINDRES_TRUE@am__objects_17 = scl2trd_res.$(OBJEXT) am_scl2trd_OBJECTS = scl2trd.$(OBJEXT) $(am__objects_17) scl2trd_OBJECTS = $(am_scl2trd_OBJECTS) scl2trd_LDADD = $(LDADD) am__snap2tzx_SOURCES_DIST = snap2tzx.c utils.c snap2tzx_res.rc @HAVE_WINDRES_TRUE@am__objects_18 = snap2tzx_res.$(OBJEXT) am_snap2tzx_OBJECTS = snap2tzx.$(OBJEXT) utils.$(OBJEXT) \ $(am__objects_18) snap2tzx_OBJECTS = $(am_snap2tzx_OBJECTS) snap2tzx_DEPENDENCIES = $(am__DEPENDENCIES_1) compat/libcompatos.a am__snapconv_SOURCES_DIST = snapconv.c utils.c snapconv_res.rc @HAVE_WINDRES_TRUE@am__objects_19 = snapconv_res.$(OBJEXT) am_snapconv_OBJECTS = snapconv.$(OBJEXT) utils.$(OBJEXT) \ $(am__objects_19) snapconv_OBJECTS = $(am_snapconv_OBJECTS) snapconv_DEPENDENCIES = $(am__DEPENDENCIES_1) compat/libcompatos.a am__snapdump_SOURCES_DIST = snapdump.c utils.c snapdump_res.rc @HAVE_WINDRES_TRUE@am__objects_20 = snapdump_res.$(OBJEXT) am_snapdump_OBJECTS = snapdump.$(OBJEXT) utils.$(OBJEXT) \ $(am__objects_20) snapdump_OBJECTS = $(am_snapdump_OBJECTS) snapdump_DEPENDENCIES = $(am__DEPENDENCIES_1) compat/libcompatos.a am__tape2pulses_SOURCES_DIST = tape2pulses.c utils.c \ tape2pulses_res.rc @HAVE_WINDRES_TRUE@am__objects_21 = tape2pulses_res.$(OBJEXT) am_tape2pulses_OBJECTS = tape2pulses.$(OBJEXT) utils.$(OBJEXT) \ $(am__objects_21) tape2pulses_OBJECTS = $(am_tape2pulses_OBJECTS) tape2pulses_DEPENDENCIES = $(am__DEPENDENCIES_1) compat/libcompatos.a am__tape2wav_SOURCES_DIST = tape2wav.c utils.c tape2wav_res.rc @HAVE_WINDRES_TRUE@am__objects_22 = tape2wav_res.$(OBJEXT) am_tape2wav_OBJECTS = tape2wav.$(OBJEXT) utils.$(OBJEXT) \ $(am__objects_22) tape2wav_OBJECTS = $(am_tape2wav_OBJECTS) tape2wav_DEPENDENCIES = $(am__DEPENDENCIES_1) compat/libcompatos.a am__tapeconv_SOURCES_DIST = tapeconv.c utils.c tapeconv_res.rc @HAVE_WINDRES_TRUE@am__objects_23 = tapeconv_res.$(OBJEXT) am_tapeconv_OBJECTS = tapeconv.$(OBJEXT) utils.$(OBJEXT) \ $(am__objects_23) tapeconv_OBJECTS = $(am_tapeconv_OBJECTS) tapeconv_DEPENDENCIES = $(am__DEPENDENCIES_1) compat/libcompatos.a am__tzxlist_SOURCES_DIST = tzxlist.c utils.c tzxlist_res.rc @HAVE_WINDRES_TRUE@am__objects_24 = tzxlist_res.$(OBJEXT) am_tzxlist_OBJECTS = tzxlist.$(OBJEXT) utils.$(OBJEXT) \ $(am__objects_24) tzxlist_OBJECTS = $(am_tzxlist_OBJECTS) tzxlist_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ compat/libcompatos.a AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/audio2tape-audio2tape.Po \ ./$(DEPDIR)/audio2tape-utils.Po ./$(DEPDIR)/createhdf.Po \ ./$(DEPDIR)/fmfconv.Po ./$(DEPDIR)/fmfconv_compr.Po \ ./$(DEPDIR)/fmfconv_types.Po ./$(DEPDIR)/ide.Po \ ./$(DEPDIR)/keys.Po ./$(DEPDIR)/listbasic.Po \ ./$(DEPDIR)/mdrlist.Po ./$(DEPDIR)/profile2map.Po \ ./$(DEPDIR)/raw2hdf.Po ./$(DEPDIR)/rzxcheck.Po \ ./$(DEPDIR)/rzxdump.Po ./$(DEPDIR)/rzxtool.Po \ ./$(DEPDIR)/scl2trd.Po ./$(DEPDIR)/snap2tzx.Po \ ./$(DEPDIR)/snapconv.Po ./$(DEPDIR)/snapdump.Po \ ./$(DEPDIR)/tape2pulses.Po ./$(DEPDIR)/tape2wav.Po \ ./$(DEPDIR)/tapeconv.Po ./$(DEPDIR)/tzxlist.Po \ ./$(DEPDIR)/utils.Po compat/$(DEPDIR)/getopt.Po \ compat/$(DEPDIR)/getopt1.Po compat/amiga/$(DEPDIR)/basename.Po \ compat/amiga/$(DEPDIR)/osname.Po \ compat/unix/$(DEPDIR)/basename.Po \ compat/unix/$(DEPDIR)/osname.Po \ compat/win32/$(DEPDIR)/osname.Po \ converter/$(DEPDIR)/audio2tape-findpilot.Po \ converter/$(DEPDIR)/audio2tape-findsync1.Po \ converter/$(DEPDIR)/audio2tape-getpulse1.Po \ converter/$(DEPDIR)/audio2tape-getpulse2.Po \ converter/$(DEPDIR)/audio2tape-getsync2.Po \ converter/$(DEPDIR)/audio2tape-romloader.Po \ converter/$(DEPDIR)/audio2tape-romloaderstate.Po \ fmfconv_output/$(DEPDIR)/fmfconv_aiff.Po \ fmfconv_output/$(DEPDIR)/fmfconv_au.Po \ fmfconv_output/$(DEPDIR)/fmfconv_avi.Po \ fmfconv_output/$(DEPDIR)/fmfconv_jpg.Po \ fmfconv_output/$(DEPDIR)/fmfconv_png.Po \ fmfconv_output/$(DEPDIR)/fmfconv_ppm.Po \ fmfconv_output/$(DEPDIR)/fmfconv_scr.Po \ fmfconv_output/$(DEPDIR)/fmfconv_wav.Po \ fmfconv_output/$(DEPDIR)/fmfconv_yuv.Po \ importer/$(DEPDIR)/audio2tape-soundfile.Po \ importer/$(DEPDIR)/audio2tape-trigger.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(compat_libcompatos_a_SOURCES) $(audio2tape_SOURCES) \ $(createhdf_SOURCES) $(fmfconv_SOURCES) $(listbasic_SOURCES) \ $(mdrlist_SOURCES) $(profile2map_SOURCES) $(raw2hdf_SOURCES) \ $(rzxcheck_SOURCES) $(rzxdump_SOURCES) $(rzxtool_SOURCES) \ $(scl2trd_SOURCES) $(snap2tzx_SOURCES) $(snapconv_SOURCES) \ $(snapdump_SOURCES) $(tape2pulses_SOURCES) $(tape2wav_SOURCES) \ $(tapeconv_SOURCES) $(tzxlist_SOURCES) DIST_SOURCES = $(am__compat_libcompatos_a_SOURCES_DIST) \ $(am__audio2tape_SOURCES_DIST) $(am__createhdf_SOURCES_DIST) \ $(am__fmfconv_SOURCES_DIST) $(am__listbasic_SOURCES_DIST) \ $(am__mdrlist_SOURCES_DIST) $(am__profile2map_SOURCES_DIST) \ $(am__raw2hdf_SOURCES_DIST) $(am__rzxcheck_SOURCES_DIST) \ $(am__rzxdump_SOURCES_DIST) $(am__rzxtool_SOURCES_DIST) \ $(am__scl2trd_SOURCES_DIST) $(am__snap2tzx_SOURCES_DIST) \ $(am__snapconv_SOURCES_DIST) $(am__snapdump_SOURCES_DIST) \ $(am__tape2pulses_SOURCES_DIST) $(am__tape2wav_SOURCES_DIST) \ $(am__tapeconv_SOURCES_DIST) $(am__tzxlist_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` AM_RECURSIVE_TARGETS = cscope am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/compat/Makefile.am \ $(srcdir)/compat/win32/distribution.mk $(srcdir)/config.h.in \ $(srcdir)/fuse-utils.qpg.in $(srcdir)/hacking/Makefile.am \ $(srcdir)/m4/Makefile.am $(srcdir)/man/Makefile.am \ $(srcdir)/tests/Makefile.am AUTHORS COPYING ChangeLog README \ compile config.guess config.rpath config.sub depcomp \ install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -700 -exec chmod u+rwx {} ';' \ ; rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = -9 DIST_TARGETS = dist-gzip # Exists only to be overridden by the user if desired. AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = \ find . \( -type f -a \! \ \( -name .nfs* -o -name .smb* -o -name .__afs* \) \) -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUDIOFILE_CFLAGS = @AUDIOFILE_CFLAGS@ AUDIOFILE_CONFIG = @AUDIOFILE_CONFIG@ AUDIOFILE_LIBS = @AUDIOFILE_LIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ GROFF = @GROFF@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIBS = @JPEG_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSPECTRUM_CFLAGS = @LIBSPECTRUM_CFLAGS@ LIBSPECTRUM_LIBS = @LIBSPECTRUM_LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PNG_LIBS = @PNG_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UNIX2DOS = @UNIX2DOS@ VERSION = @VERSION@ WINDRES = @WINDRES@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 AM_CPPFLAGS = $(LIBSPECTRUM_CFLAGS) $(GLIB_CFLAGS) createhdf_SOURCES = ide.c createhdf.c $(am__append_10) fmfconv_SOURCES = fmfconv.c fmfconv_compr.c fmfconv_types.c \ fmfconv_output/fmfconv_aiff.c fmfconv_output/fmfconv_au.c \ fmfconv_output/fmfconv_avi.c fmfconv_output/fmfconv_ppm.c \ fmfconv_output/fmfconv_scr.c fmfconv_output/fmfconv_wav.c \ fmfconv_output/fmfconv_yuv.c $(am__append_3) $(am__append_4) \ $(am__append_5) $(am__append_11) fmfconv_LDADD = $(JPEG_LIBS) $(PNG_LIBS) compat/libcompatos.a listbasic_SOURCES = listbasic.c utils.c $(am__append_12) listbasic_LDADD = $(LIBSPECTRUM_LIBS) compat/libcompatos.a mdrlist_SOURCES = mdrlist.c utils.c $(am__append_13) mdrlist_LDADD = $(LIBSPECTRUM_LIBS) compat/libcompatos.a profile2map_SOURCES = profile2map.c utils.c $(am__append_14) profile2map_LDADD = $(LIBSPECTRUM_LIBS) compat/libcompatos.a raw2hdf_SOURCES = ide.c raw2hdf.c $(am__append_15) rzxcheck_SOURCES = rzxcheck.c keys.c utils.c $(am__append_16) rzxcheck_LDADD = $(LIBSPECTRUM_LIBS) compat/libcompatos.a rzxdump_SOURCES = rzxdump.c utils.c $(am__append_17) rzxdump_LDADD = $(LIBSPECTRUM_LIBS) compat/libcompatos.a rzxtool_SOURCES = rzxtool.c utils.c $(am__append_18) rzxtool_LDADD = $(LIBSPECTRUM_LIBS) compat/libcompatos.a scl2trd_SOURCES = scl2trd.c $(am__append_19) snap2tzx_SOURCES = snap2tzx.c utils.c $(am__append_20) snap2tzx_LDADD = $(LIBSPECTRUM_LIBS) compat/libcompatos.a snapconv_SOURCES = snapconv.c utils.c $(am__append_21) snapconv_LDADD = $(LIBSPECTRUM_LIBS) compat/libcompatos.a snapdump_SOURCES = snapdump.c utils.c $(am__append_22) snapdump_LDADD = $(LIBSPECTRUM_LIBS) compat/libcompatos.a tapeconv_SOURCES = tapeconv.c utils.c $(am__append_25) tapeconv_LDADD = $(LIBSPECTRUM_LIBS) compat/libcompatos.a tzxlist_SOURCES = tzxlist.c utils.c $(am__append_26) tzxlist_LDADD = $(LIBSPECTRUM_LIBS) $(LTLIBICONV) compat/libcompatos.a audio2tape_SOURCES = audio2tape.cc importer/soundfile.cc \ importer/trigger.cc converter/findpilot.cc \ converter/findsync1.cc converter/getpulse1.cc \ converter/getpulse2.cc converter/getsync2.cc \ converter/romloader.cc converter/romloaderstate.cc utils.c \ $(am__append_9) audio2tape_CPPFLAGS = $(AM_CPPFLAGS) $(AUDIOFILE_CFLAGS) audio2tape_LDADD = $(LIBSPECTRUM_LIBS) $(AUDIOFILE_LIBS) \ compat/libcompatos.a tape2wav_SOURCES = tape2wav.c utils.c $(am__append_24) tape2wav_LDADD = $(LIBSPECTRUM_LIBS) \ compat/libcompatos.a tape2pulses_SOURCES = tape2pulses.c utils.c $(am__append_23) tape2pulses_LDADD = $(LIBSPECTRUM_LIBS) compat/libcompatos.a noinst_HEADERS = compat.h ide.h utils.h audio2tape.h importer/interpolator.h \ importer/schmitt.h importer/simple.h importer/soundfile.h \ importer/trigger.h converter/findpilot.h \ converter/findsync1.h converter/getpulse1.h \ converter/getpulse2.h converter/getsync2.h \ converter/romloader.h converter/romloaderstate.h \ compat/getopt.h fmfconv.h fmfconv_compr.h fmfconv_types.h \ movie_tables.h noinst_LIBRARIES = compat/libcompatos.a EXTRA_DIST = update-release.py .agents/skills/README.md \ .agents/skills/update-changelog/SKILL.md \ compat/win32/check_win32_dll_deps.sh hacking/cvs-tags \ hacking/releasing.md m4/audiofile.m4 m4/ax_create_stdint_h.m4 \ m4/iconv.m4 m4/lib-ld.m4 m4/lib-link.m4 m4/lib-prefix.m4 \ m4/pkg.m4 $(man_MANS) tests/tapeconv_roundtrip.sh \ tests/snapconv_roundtrip.sh tests/tzxlist_listing.sh \ tests/fixtures/tap-standard.tap tests/fixtures/sna-48k.sna compat_libcompatos_a_SOURCES = $(am__append_6) $(am__append_7) \ $(am__append_8) @COMPAT_WIN32_TRUE@package_win32 = $(PACKAGE)-$(PACKAGE_VERSION)-win32 @COMPAT_WIN32_TRUE@top_win32dir = $(top_builddir)/$(package_win32) man_MANS = \ man/audio2tape.1 \ man/createhdf.1 \ man/fmfconv.1 \ man/fuse-utils.1 \ man/listbasic.1 \ man/mdrlist.1 \ man/profile2map.1 \ man/raw2hdf.1 \ man/rzxcheck.1 \ man/rzxdump.1 \ man/rzxtool.1 \ man/scl2trd.1 \ man/snap2tzx.1 \ man/snapconv.1 \ man/snapdump.1 \ man/tape2pulses.1 \ man/tape2wav.1 \ man/tapeconv.1 \ man/tzxlist.1 all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .cc .lo .o .obj .rc am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/compat/Makefile.am $(srcdir)/compat/win32/distribution.mk $(srcdir)/hacking/Makefile.am $(srcdir)/m4/Makefile.am $(srcdir)/man/Makefile.am $(srcdir)/tests/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(srcdir)/compat/Makefile.am $(srcdir)/compat/win32/distribution.mk $(srcdir)/hacking/Makefile.am $(srcdir)/m4/Makefile.am $(srcdir)/man/Makefile.am $(srcdir)/tests/Makefile.am $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status $(AM_V_at)rm -f stamp-h1 $(AM_V_GEN)cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) $(AM_V_GEN)($(am__cd) $(top_srcdir) && $(AUTOHEADER)) $(AM_V_at)rm -f stamp-h1 $(AM_V_at)touch $@ distclean-hdr: -rm -f config.h stamp-h1 fuse-utils.qpg: $(top_builddir)/config.status $(srcdir)/fuse-utils.qpg.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && $(am__rm_f) $$files clean-binPROGRAMS: $(am__rm_f) $(bin_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(bin_PROGRAMS:$(EXEEXT)=) clean-noinstLIBRARIES: -$(am__rm_f) $(noinst_LIBRARIES) compat/amiga/$(am__dirstamp): @$(MKDIR_P) compat/amiga @: >>compat/amiga/$(am__dirstamp) compat/amiga/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) compat/amiga/$(DEPDIR) @: >>compat/amiga/$(DEPDIR)/$(am__dirstamp) compat/amiga/basename.$(OBJEXT): compat/amiga/$(am__dirstamp) \ compat/amiga/$(DEPDIR)/$(am__dirstamp) compat/amiga/osname.$(OBJEXT): compat/amiga/$(am__dirstamp) \ compat/amiga/$(DEPDIR)/$(am__dirstamp) compat/unix/$(am__dirstamp): @$(MKDIR_P) compat/unix @: >>compat/unix/$(am__dirstamp) compat/unix/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) compat/unix/$(DEPDIR) @: >>compat/unix/$(DEPDIR)/$(am__dirstamp) compat/unix/basename.$(OBJEXT): compat/unix/$(am__dirstamp) \ compat/unix/$(DEPDIR)/$(am__dirstamp) compat/unix/osname.$(OBJEXT): compat/unix/$(am__dirstamp) \ compat/unix/$(DEPDIR)/$(am__dirstamp) compat/win32/$(am__dirstamp): @$(MKDIR_P) compat/win32 @: >>compat/win32/$(am__dirstamp) compat/win32/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) compat/win32/$(DEPDIR) @: >>compat/win32/$(DEPDIR)/$(am__dirstamp) compat/win32/osname.$(OBJEXT): compat/win32/$(am__dirstamp) \ compat/win32/$(DEPDIR)/$(am__dirstamp) compat/$(am__dirstamp): @$(MKDIR_P) compat @: >>compat/$(am__dirstamp) compat/libcompatos.a: $(compat_libcompatos_a_OBJECTS) $(compat_libcompatos_a_DEPENDENCIES) $(EXTRA_compat_libcompatos_a_DEPENDENCIES) compat/$(am__dirstamp) $(AM_V_at)-rm -f compat/libcompatos.a $(AM_V_AR)$(compat_libcompatos_a_AR) compat/libcompatos.a $(compat_libcompatos_a_OBJECTS) $(compat_libcompatos_a_LIBADD) $(AM_V_at)$(compat_libcompatos_a_RANLIB) compat/libcompatos.a importer/$(am__dirstamp): @$(MKDIR_P) importer @: >>importer/$(am__dirstamp) importer/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) importer/$(DEPDIR) @: >>importer/$(DEPDIR)/$(am__dirstamp) importer/audio2tape-soundfile.$(OBJEXT): importer/$(am__dirstamp) \ importer/$(DEPDIR)/$(am__dirstamp) importer/audio2tape-trigger.$(OBJEXT): importer/$(am__dirstamp) \ importer/$(DEPDIR)/$(am__dirstamp) converter/$(am__dirstamp): @$(MKDIR_P) converter @: >>converter/$(am__dirstamp) converter/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) converter/$(DEPDIR) @: >>converter/$(DEPDIR)/$(am__dirstamp) converter/audio2tape-findpilot.$(OBJEXT): converter/$(am__dirstamp) \ converter/$(DEPDIR)/$(am__dirstamp) converter/audio2tape-findsync1.$(OBJEXT): converter/$(am__dirstamp) \ converter/$(DEPDIR)/$(am__dirstamp) converter/audio2tape-getpulse1.$(OBJEXT): converter/$(am__dirstamp) \ converter/$(DEPDIR)/$(am__dirstamp) converter/audio2tape-getpulse2.$(OBJEXT): converter/$(am__dirstamp) \ converter/$(DEPDIR)/$(am__dirstamp) converter/audio2tape-getsync2.$(OBJEXT): converter/$(am__dirstamp) \ converter/$(DEPDIR)/$(am__dirstamp) converter/audio2tape-romloader.$(OBJEXT): converter/$(am__dirstamp) \ converter/$(DEPDIR)/$(am__dirstamp) converter/audio2tape-romloaderstate.$(OBJEXT): \ converter/$(am__dirstamp) converter/$(DEPDIR)/$(am__dirstamp) audio2tape$(EXEEXT): $(audio2tape_OBJECTS) $(audio2tape_DEPENDENCIES) $(EXTRA_audio2tape_DEPENDENCIES) @rm -f audio2tape$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(audio2tape_OBJECTS) $(audio2tape_LDADD) $(LIBS) createhdf$(EXEEXT): $(createhdf_OBJECTS) $(createhdf_DEPENDENCIES) $(EXTRA_createhdf_DEPENDENCIES) @rm -f createhdf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(createhdf_OBJECTS) $(createhdf_LDADD) $(LIBS) fmfconv_output/$(am__dirstamp): @$(MKDIR_P) fmfconv_output @: >>fmfconv_output/$(am__dirstamp) fmfconv_output/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) fmfconv_output/$(DEPDIR) @: >>fmfconv_output/$(DEPDIR)/$(am__dirstamp) fmfconv_output/fmfconv_aiff.$(OBJEXT): fmfconv_output/$(am__dirstamp) \ fmfconv_output/$(DEPDIR)/$(am__dirstamp) fmfconv_output/fmfconv_au.$(OBJEXT): fmfconv_output/$(am__dirstamp) \ fmfconv_output/$(DEPDIR)/$(am__dirstamp) fmfconv_output/fmfconv_avi.$(OBJEXT): fmfconv_output/$(am__dirstamp) \ fmfconv_output/$(DEPDIR)/$(am__dirstamp) fmfconv_output/fmfconv_ppm.$(OBJEXT): fmfconv_output/$(am__dirstamp) \ fmfconv_output/$(DEPDIR)/$(am__dirstamp) fmfconv_output/fmfconv_scr.$(OBJEXT): fmfconv_output/$(am__dirstamp) \ fmfconv_output/$(DEPDIR)/$(am__dirstamp) fmfconv_output/fmfconv_wav.$(OBJEXT): fmfconv_output/$(am__dirstamp) \ fmfconv_output/$(DEPDIR)/$(am__dirstamp) fmfconv_output/fmfconv_yuv.$(OBJEXT): fmfconv_output/$(am__dirstamp) \ fmfconv_output/$(DEPDIR)/$(am__dirstamp) compat/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) compat/$(DEPDIR) @: >>compat/$(DEPDIR)/$(am__dirstamp) compat/getopt.$(OBJEXT): compat/$(am__dirstamp) \ compat/$(DEPDIR)/$(am__dirstamp) compat/getopt1.$(OBJEXT): compat/$(am__dirstamp) \ compat/$(DEPDIR)/$(am__dirstamp) fmfconv_output/fmfconv_jpg.$(OBJEXT): fmfconv_output/$(am__dirstamp) \ fmfconv_output/$(DEPDIR)/$(am__dirstamp) fmfconv_output/fmfconv_png.$(OBJEXT): fmfconv_output/$(am__dirstamp) \ fmfconv_output/$(DEPDIR)/$(am__dirstamp) fmfconv$(EXEEXT): $(fmfconv_OBJECTS) $(fmfconv_DEPENDENCIES) $(EXTRA_fmfconv_DEPENDENCIES) @rm -f fmfconv$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fmfconv_OBJECTS) $(fmfconv_LDADD) $(LIBS) listbasic$(EXEEXT): $(listbasic_OBJECTS) $(listbasic_DEPENDENCIES) $(EXTRA_listbasic_DEPENDENCIES) @rm -f listbasic$(EXEEXT) $(AM_V_CCLD)$(LINK) $(listbasic_OBJECTS) $(listbasic_LDADD) $(LIBS) mdrlist$(EXEEXT): $(mdrlist_OBJECTS) $(mdrlist_DEPENDENCIES) $(EXTRA_mdrlist_DEPENDENCIES) @rm -f mdrlist$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mdrlist_OBJECTS) $(mdrlist_LDADD) $(LIBS) profile2map$(EXEEXT): $(profile2map_OBJECTS) $(profile2map_DEPENDENCIES) $(EXTRA_profile2map_DEPENDENCIES) @rm -f profile2map$(EXEEXT) $(AM_V_CCLD)$(LINK) $(profile2map_OBJECTS) $(profile2map_LDADD) $(LIBS) raw2hdf$(EXEEXT): $(raw2hdf_OBJECTS) $(raw2hdf_DEPENDENCIES) $(EXTRA_raw2hdf_DEPENDENCIES) @rm -f raw2hdf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(raw2hdf_OBJECTS) $(raw2hdf_LDADD) $(LIBS) rzxcheck$(EXEEXT): $(rzxcheck_OBJECTS) $(rzxcheck_DEPENDENCIES) $(EXTRA_rzxcheck_DEPENDENCIES) @rm -f rzxcheck$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rzxcheck_OBJECTS) $(rzxcheck_LDADD) $(LIBS) rzxdump$(EXEEXT): $(rzxdump_OBJECTS) $(rzxdump_DEPENDENCIES) $(EXTRA_rzxdump_DEPENDENCIES) @rm -f rzxdump$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rzxdump_OBJECTS) $(rzxdump_LDADD) $(LIBS) rzxtool$(EXEEXT): $(rzxtool_OBJECTS) $(rzxtool_DEPENDENCIES) $(EXTRA_rzxtool_DEPENDENCIES) @rm -f rzxtool$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rzxtool_OBJECTS) $(rzxtool_LDADD) $(LIBS) scl2trd$(EXEEXT): $(scl2trd_OBJECTS) $(scl2trd_DEPENDENCIES) $(EXTRA_scl2trd_DEPENDENCIES) @rm -f scl2trd$(EXEEXT) $(AM_V_CCLD)$(LINK) $(scl2trd_OBJECTS) $(scl2trd_LDADD) $(LIBS) snap2tzx$(EXEEXT): $(snap2tzx_OBJECTS) $(snap2tzx_DEPENDENCIES) $(EXTRA_snap2tzx_DEPENDENCIES) @rm -f snap2tzx$(EXEEXT) $(AM_V_CCLD)$(LINK) $(snap2tzx_OBJECTS) $(snap2tzx_LDADD) $(LIBS) snapconv$(EXEEXT): $(snapconv_OBJECTS) $(snapconv_DEPENDENCIES) $(EXTRA_snapconv_DEPENDENCIES) @rm -f snapconv$(EXEEXT) $(AM_V_CCLD)$(LINK) $(snapconv_OBJECTS) $(snapconv_LDADD) $(LIBS) snapdump$(EXEEXT): $(snapdump_OBJECTS) $(snapdump_DEPENDENCIES) $(EXTRA_snapdump_DEPENDENCIES) @rm -f snapdump$(EXEEXT) $(AM_V_CCLD)$(LINK) $(snapdump_OBJECTS) $(snapdump_LDADD) $(LIBS) tape2pulses$(EXEEXT): $(tape2pulses_OBJECTS) $(tape2pulses_DEPENDENCIES) $(EXTRA_tape2pulses_DEPENDENCIES) @rm -f tape2pulses$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tape2pulses_OBJECTS) $(tape2pulses_LDADD) $(LIBS) tape2wav$(EXEEXT): $(tape2wav_OBJECTS) $(tape2wav_DEPENDENCIES) $(EXTRA_tape2wav_DEPENDENCIES) @rm -f tape2wav$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tape2wav_OBJECTS) $(tape2wav_LDADD) $(LIBS) tapeconv$(EXEEXT): $(tapeconv_OBJECTS) $(tapeconv_DEPENDENCIES) $(EXTRA_tapeconv_DEPENDENCIES) @rm -f tapeconv$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tapeconv_OBJECTS) $(tapeconv_LDADD) $(LIBS) tzxlist$(EXEEXT): $(tzxlist_OBJECTS) $(tzxlist_DEPENDENCIES) $(EXTRA_tzxlist_DEPENDENCIES) @rm -f tzxlist$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tzxlist_OBJECTS) $(tzxlist_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f compat/*.$(OBJEXT) -rm -f compat/amiga/*.$(OBJEXT) -rm -f compat/unix/*.$(OBJEXT) -rm -f compat/win32/*.$(OBJEXT) -rm -f converter/*.$(OBJEXT) -rm -f fmfconv_output/*.$(OBJEXT) -rm -f importer/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio2tape-audio2tape.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio2tape-utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/createhdf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fmfconv.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fmfconv_compr.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fmfconv_types.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ide.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keys.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listbasic.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mdrlist.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/profile2map.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw2hdf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rzxcheck.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rzxdump.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rzxtool.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scl2trd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snap2tzx.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snapconv.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snapdump.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape2pulses.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape2wav.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tapeconv.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tzxlist.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getopt1.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@compat/amiga/$(DEPDIR)/basename.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@compat/amiga/$(DEPDIR)/osname.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@compat/unix/$(DEPDIR)/basename.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@compat/unix/$(DEPDIR)/osname.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@compat/win32/$(DEPDIR)/osname.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@converter/$(DEPDIR)/audio2tape-findpilot.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@converter/$(DEPDIR)/audio2tape-findsync1.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@converter/$(DEPDIR)/audio2tape-getpulse1.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@converter/$(DEPDIR)/audio2tape-getpulse2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@converter/$(DEPDIR)/audio2tape-getsync2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@converter/$(DEPDIR)/audio2tape-romloader.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@converter/$(DEPDIR)/audio2tape-romloaderstate.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@fmfconv_output/$(DEPDIR)/fmfconv_aiff.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@fmfconv_output/$(DEPDIR)/fmfconv_au.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@fmfconv_output/$(DEPDIR)/fmfconv_avi.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@fmfconv_output/$(DEPDIR)/fmfconv_jpg.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@fmfconv_output/$(DEPDIR)/fmfconv_png.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@fmfconv_output/$(DEPDIR)/fmfconv_ppm.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@fmfconv_output/$(DEPDIR)/fmfconv_scr.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@fmfconv_output/$(DEPDIR)/fmfconv_wav.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@fmfconv_output/$(DEPDIR)/fmfconv_yuv.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@importer/$(DEPDIR)/audio2tape-soundfile.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@importer/$(DEPDIR)/audio2tape-trigger.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< audio2tape-utils.o: utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT audio2tape-utils.o -MD -MP -MF $(DEPDIR)/audio2tape-utils.Tpo -c -o audio2tape-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audio2tape-utils.Tpo $(DEPDIR)/audio2tape-utils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils.c' object='audio2tape-utils.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o audio2tape-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c audio2tape-utils.obj: utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT audio2tape-utils.obj -MD -MP -MF $(DEPDIR)/audio2tape-utils.Tpo -c -o audio2tape-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audio2tape-utils.Tpo $(DEPDIR)/audio2tape-utils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils.c' object='audio2tape-utils.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o audio2tape-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi` .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< audio2tape-audio2tape.o: audio2tape.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT audio2tape-audio2tape.o -MD -MP -MF $(DEPDIR)/audio2tape-audio2tape.Tpo -c -o audio2tape-audio2tape.o `test -f 'audio2tape.cc' || echo '$(srcdir)/'`audio2tape.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audio2tape-audio2tape.Tpo $(DEPDIR)/audio2tape-audio2tape.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='audio2tape.cc' object='audio2tape-audio2tape.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o audio2tape-audio2tape.o `test -f 'audio2tape.cc' || echo '$(srcdir)/'`audio2tape.cc audio2tape-audio2tape.obj: audio2tape.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT audio2tape-audio2tape.obj -MD -MP -MF $(DEPDIR)/audio2tape-audio2tape.Tpo -c -o audio2tape-audio2tape.obj `if test -f 'audio2tape.cc'; then $(CYGPATH_W) 'audio2tape.cc'; else $(CYGPATH_W) '$(srcdir)/audio2tape.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audio2tape-audio2tape.Tpo $(DEPDIR)/audio2tape-audio2tape.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='audio2tape.cc' object='audio2tape-audio2tape.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o audio2tape-audio2tape.obj `if test -f 'audio2tape.cc'; then $(CYGPATH_W) 'audio2tape.cc'; else $(CYGPATH_W) '$(srcdir)/audio2tape.cc'; fi` importer/audio2tape-soundfile.o: importer/soundfile.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT importer/audio2tape-soundfile.o -MD -MP -MF importer/$(DEPDIR)/audio2tape-soundfile.Tpo -c -o importer/audio2tape-soundfile.o `test -f 'importer/soundfile.cc' || echo '$(srcdir)/'`importer/soundfile.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) importer/$(DEPDIR)/audio2tape-soundfile.Tpo importer/$(DEPDIR)/audio2tape-soundfile.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='importer/soundfile.cc' object='importer/audio2tape-soundfile.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o importer/audio2tape-soundfile.o `test -f 'importer/soundfile.cc' || echo '$(srcdir)/'`importer/soundfile.cc importer/audio2tape-soundfile.obj: importer/soundfile.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT importer/audio2tape-soundfile.obj -MD -MP -MF importer/$(DEPDIR)/audio2tape-soundfile.Tpo -c -o importer/audio2tape-soundfile.obj `if test -f 'importer/soundfile.cc'; then $(CYGPATH_W) 'importer/soundfile.cc'; else $(CYGPATH_W) '$(srcdir)/importer/soundfile.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) importer/$(DEPDIR)/audio2tape-soundfile.Tpo importer/$(DEPDIR)/audio2tape-soundfile.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='importer/soundfile.cc' object='importer/audio2tape-soundfile.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o importer/audio2tape-soundfile.obj `if test -f 'importer/soundfile.cc'; then $(CYGPATH_W) 'importer/soundfile.cc'; else $(CYGPATH_W) '$(srcdir)/importer/soundfile.cc'; fi` importer/audio2tape-trigger.o: importer/trigger.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT importer/audio2tape-trigger.o -MD -MP -MF importer/$(DEPDIR)/audio2tape-trigger.Tpo -c -o importer/audio2tape-trigger.o `test -f 'importer/trigger.cc' || echo '$(srcdir)/'`importer/trigger.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) importer/$(DEPDIR)/audio2tape-trigger.Tpo importer/$(DEPDIR)/audio2tape-trigger.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='importer/trigger.cc' object='importer/audio2tape-trigger.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o importer/audio2tape-trigger.o `test -f 'importer/trigger.cc' || echo '$(srcdir)/'`importer/trigger.cc importer/audio2tape-trigger.obj: importer/trigger.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT importer/audio2tape-trigger.obj -MD -MP -MF importer/$(DEPDIR)/audio2tape-trigger.Tpo -c -o importer/audio2tape-trigger.obj `if test -f 'importer/trigger.cc'; then $(CYGPATH_W) 'importer/trigger.cc'; else $(CYGPATH_W) '$(srcdir)/importer/trigger.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) importer/$(DEPDIR)/audio2tape-trigger.Tpo importer/$(DEPDIR)/audio2tape-trigger.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='importer/trigger.cc' object='importer/audio2tape-trigger.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o importer/audio2tape-trigger.obj `if test -f 'importer/trigger.cc'; then $(CYGPATH_W) 'importer/trigger.cc'; else $(CYGPATH_W) '$(srcdir)/importer/trigger.cc'; fi` converter/audio2tape-findpilot.o: converter/findpilot.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT converter/audio2tape-findpilot.o -MD -MP -MF converter/$(DEPDIR)/audio2tape-findpilot.Tpo -c -o converter/audio2tape-findpilot.o `test -f 'converter/findpilot.cc' || echo '$(srcdir)/'`converter/findpilot.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) converter/$(DEPDIR)/audio2tape-findpilot.Tpo converter/$(DEPDIR)/audio2tape-findpilot.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='converter/findpilot.cc' object='converter/audio2tape-findpilot.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o converter/audio2tape-findpilot.o `test -f 'converter/findpilot.cc' || echo '$(srcdir)/'`converter/findpilot.cc converter/audio2tape-findpilot.obj: converter/findpilot.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT converter/audio2tape-findpilot.obj -MD -MP -MF converter/$(DEPDIR)/audio2tape-findpilot.Tpo -c -o converter/audio2tape-findpilot.obj `if test -f 'converter/findpilot.cc'; then $(CYGPATH_W) 'converter/findpilot.cc'; else $(CYGPATH_W) '$(srcdir)/converter/findpilot.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) converter/$(DEPDIR)/audio2tape-findpilot.Tpo converter/$(DEPDIR)/audio2tape-findpilot.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='converter/findpilot.cc' object='converter/audio2tape-findpilot.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o converter/audio2tape-findpilot.obj `if test -f 'converter/findpilot.cc'; then $(CYGPATH_W) 'converter/findpilot.cc'; else $(CYGPATH_W) '$(srcdir)/converter/findpilot.cc'; fi` converter/audio2tape-findsync1.o: converter/findsync1.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT converter/audio2tape-findsync1.o -MD -MP -MF converter/$(DEPDIR)/audio2tape-findsync1.Tpo -c -o converter/audio2tape-findsync1.o `test -f 'converter/findsync1.cc' || echo '$(srcdir)/'`converter/findsync1.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) converter/$(DEPDIR)/audio2tape-findsync1.Tpo converter/$(DEPDIR)/audio2tape-findsync1.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='converter/findsync1.cc' object='converter/audio2tape-findsync1.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o converter/audio2tape-findsync1.o `test -f 'converter/findsync1.cc' || echo '$(srcdir)/'`converter/findsync1.cc converter/audio2tape-findsync1.obj: converter/findsync1.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT converter/audio2tape-findsync1.obj -MD -MP -MF converter/$(DEPDIR)/audio2tape-findsync1.Tpo -c -o converter/audio2tape-findsync1.obj `if test -f 'converter/findsync1.cc'; then $(CYGPATH_W) 'converter/findsync1.cc'; else $(CYGPATH_W) '$(srcdir)/converter/findsync1.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) converter/$(DEPDIR)/audio2tape-findsync1.Tpo converter/$(DEPDIR)/audio2tape-findsync1.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='converter/findsync1.cc' object='converter/audio2tape-findsync1.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o converter/audio2tape-findsync1.obj `if test -f 'converter/findsync1.cc'; then $(CYGPATH_W) 'converter/findsync1.cc'; else $(CYGPATH_W) '$(srcdir)/converter/findsync1.cc'; fi` converter/audio2tape-getpulse1.o: converter/getpulse1.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT converter/audio2tape-getpulse1.o -MD -MP -MF converter/$(DEPDIR)/audio2tape-getpulse1.Tpo -c -o converter/audio2tape-getpulse1.o `test -f 'converter/getpulse1.cc' || echo '$(srcdir)/'`converter/getpulse1.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) converter/$(DEPDIR)/audio2tape-getpulse1.Tpo converter/$(DEPDIR)/audio2tape-getpulse1.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='converter/getpulse1.cc' object='converter/audio2tape-getpulse1.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o converter/audio2tape-getpulse1.o `test -f 'converter/getpulse1.cc' || echo '$(srcdir)/'`converter/getpulse1.cc converter/audio2tape-getpulse1.obj: converter/getpulse1.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT converter/audio2tape-getpulse1.obj -MD -MP -MF converter/$(DEPDIR)/audio2tape-getpulse1.Tpo -c -o converter/audio2tape-getpulse1.obj `if test -f 'converter/getpulse1.cc'; then $(CYGPATH_W) 'converter/getpulse1.cc'; else $(CYGPATH_W) '$(srcdir)/converter/getpulse1.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) converter/$(DEPDIR)/audio2tape-getpulse1.Tpo converter/$(DEPDIR)/audio2tape-getpulse1.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='converter/getpulse1.cc' object='converter/audio2tape-getpulse1.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o converter/audio2tape-getpulse1.obj `if test -f 'converter/getpulse1.cc'; then $(CYGPATH_W) 'converter/getpulse1.cc'; else $(CYGPATH_W) '$(srcdir)/converter/getpulse1.cc'; fi` converter/audio2tape-getpulse2.o: converter/getpulse2.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT converter/audio2tape-getpulse2.o -MD -MP -MF converter/$(DEPDIR)/audio2tape-getpulse2.Tpo -c -o converter/audio2tape-getpulse2.o `test -f 'converter/getpulse2.cc' || echo '$(srcdir)/'`converter/getpulse2.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) converter/$(DEPDIR)/audio2tape-getpulse2.Tpo converter/$(DEPDIR)/audio2tape-getpulse2.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='converter/getpulse2.cc' object='converter/audio2tape-getpulse2.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o converter/audio2tape-getpulse2.o `test -f 'converter/getpulse2.cc' || echo '$(srcdir)/'`converter/getpulse2.cc converter/audio2tape-getpulse2.obj: converter/getpulse2.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT converter/audio2tape-getpulse2.obj -MD -MP -MF converter/$(DEPDIR)/audio2tape-getpulse2.Tpo -c -o converter/audio2tape-getpulse2.obj `if test -f 'converter/getpulse2.cc'; then $(CYGPATH_W) 'converter/getpulse2.cc'; else $(CYGPATH_W) '$(srcdir)/converter/getpulse2.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) converter/$(DEPDIR)/audio2tape-getpulse2.Tpo converter/$(DEPDIR)/audio2tape-getpulse2.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='converter/getpulse2.cc' object='converter/audio2tape-getpulse2.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o converter/audio2tape-getpulse2.obj `if test -f 'converter/getpulse2.cc'; then $(CYGPATH_W) 'converter/getpulse2.cc'; else $(CYGPATH_W) '$(srcdir)/converter/getpulse2.cc'; fi` converter/audio2tape-getsync2.o: converter/getsync2.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT converter/audio2tape-getsync2.o -MD -MP -MF converter/$(DEPDIR)/audio2tape-getsync2.Tpo -c -o converter/audio2tape-getsync2.o `test -f 'converter/getsync2.cc' || echo '$(srcdir)/'`converter/getsync2.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) converter/$(DEPDIR)/audio2tape-getsync2.Tpo converter/$(DEPDIR)/audio2tape-getsync2.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='converter/getsync2.cc' object='converter/audio2tape-getsync2.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o converter/audio2tape-getsync2.o `test -f 'converter/getsync2.cc' || echo '$(srcdir)/'`converter/getsync2.cc converter/audio2tape-getsync2.obj: converter/getsync2.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT converter/audio2tape-getsync2.obj -MD -MP -MF converter/$(DEPDIR)/audio2tape-getsync2.Tpo -c -o converter/audio2tape-getsync2.obj `if test -f 'converter/getsync2.cc'; then $(CYGPATH_W) 'converter/getsync2.cc'; else $(CYGPATH_W) '$(srcdir)/converter/getsync2.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) converter/$(DEPDIR)/audio2tape-getsync2.Tpo converter/$(DEPDIR)/audio2tape-getsync2.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='converter/getsync2.cc' object='converter/audio2tape-getsync2.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o converter/audio2tape-getsync2.obj `if test -f 'converter/getsync2.cc'; then $(CYGPATH_W) 'converter/getsync2.cc'; else $(CYGPATH_W) '$(srcdir)/converter/getsync2.cc'; fi` converter/audio2tape-romloader.o: converter/romloader.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT converter/audio2tape-romloader.o -MD -MP -MF converter/$(DEPDIR)/audio2tape-romloader.Tpo -c -o converter/audio2tape-romloader.o `test -f 'converter/romloader.cc' || echo '$(srcdir)/'`converter/romloader.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) converter/$(DEPDIR)/audio2tape-romloader.Tpo converter/$(DEPDIR)/audio2tape-romloader.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='converter/romloader.cc' object='converter/audio2tape-romloader.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o converter/audio2tape-romloader.o `test -f 'converter/romloader.cc' || echo '$(srcdir)/'`converter/romloader.cc converter/audio2tape-romloader.obj: converter/romloader.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT converter/audio2tape-romloader.obj -MD -MP -MF converter/$(DEPDIR)/audio2tape-romloader.Tpo -c -o converter/audio2tape-romloader.obj `if test -f 'converter/romloader.cc'; then $(CYGPATH_W) 'converter/romloader.cc'; else $(CYGPATH_W) '$(srcdir)/converter/romloader.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) converter/$(DEPDIR)/audio2tape-romloader.Tpo converter/$(DEPDIR)/audio2tape-romloader.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='converter/romloader.cc' object='converter/audio2tape-romloader.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o converter/audio2tape-romloader.obj `if test -f 'converter/romloader.cc'; then $(CYGPATH_W) 'converter/romloader.cc'; else $(CYGPATH_W) '$(srcdir)/converter/romloader.cc'; fi` converter/audio2tape-romloaderstate.o: converter/romloaderstate.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT converter/audio2tape-romloaderstate.o -MD -MP -MF converter/$(DEPDIR)/audio2tape-romloaderstate.Tpo -c -o converter/audio2tape-romloaderstate.o `test -f 'converter/romloaderstate.cc' || echo '$(srcdir)/'`converter/romloaderstate.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) converter/$(DEPDIR)/audio2tape-romloaderstate.Tpo converter/$(DEPDIR)/audio2tape-romloaderstate.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='converter/romloaderstate.cc' object='converter/audio2tape-romloaderstate.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o converter/audio2tape-romloaderstate.o `test -f 'converter/romloaderstate.cc' || echo '$(srcdir)/'`converter/romloaderstate.cc converter/audio2tape-romloaderstate.obj: converter/romloaderstate.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT converter/audio2tape-romloaderstate.obj -MD -MP -MF converter/$(DEPDIR)/audio2tape-romloaderstate.Tpo -c -o converter/audio2tape-romloaderstate.obj `if test -f 'converter/romloaderstate.cc'; then $(CYGPATH_W) 'converter/romloaderstate.cc'; else $(CYGPATH_W) '$(srcdir)/converter/romloaderstate.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) converter/$(DEPDIR)/audio2tape-romloaderstate.Tpo converter/$(DEPDIR)/audio2tape-romloaderstate.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='converter/romloaderstate.cc' object='converter/audio2tape-romloaderstate.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audio2tape_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o converter/audio2tape-romloaderstate.obj `if test -f 'converter/romloaderstate.cc'; then $(CYGPATH_W) 'converter/romloaderstate.cc'; else $(CYGPATH_W) '$(srcdir)/converter/romloaderstate.cc'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) $(AM_V_at)$(MKDIR_P) "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-bzip3: distdir tardir=$(distdir) && $(am__tar) | bzip3 -c >$(distdir).tar.bz3 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-zstd: distdir tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.bz3*) \ bzip3 -dc $(distdir).tar.bz3 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local check: check-am all-am: Makefile $(PROGRAMS) $(LIBRARIES) $(MANS) $(HEADERS) config.h installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) -$(am__rm_f) compat/$(DEPDIR)/$(am__dirstamp) -$(am__rm_f) compat/$(am__dirstamp) -$(am__rm_f) compat/amiga/$(DEPDIR)/$(am__dirstamp) -$(am__rm_f) compat/amiga/$(am__dirstamp) -$(am__rm_f) compat/unix/$(DEPDIR)/$(am__dirstamp) -$(am__rm_f) compat/unix/$(am__dirstamp) -$(am__rm_f) compat/win32/$(DEPDIR)/$(am__dirstamp) -$(am__rm_f) compat/win32/$(am__dirstamp) -$(am__rm_f) converter/$(DEPDIR)/$(am__dirstamp) -$(am__rm_f) converter/$(am__dirstamp) -$(am__rm_f) fmfconv_output/$(DEPDIR)/$(am__dirstamp) -$(am__rm_f) fmfconv_output/$(am__dirstamp) -$(am__rm_f) importer/$(DEPDIR)/$(am__dirstamp) -$(am__rm_f) importer/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f ./$(DEPDIR)/audio2tape-audio2tape.Po -rm -f ./$(DEPDIR)/audio2tape-utils.Po -rm -f ./$(DEPDIR)/createhdf.Po -rm -f ./$(DEPDIR)/fmfconv.Po -rm -f ./$(DEPDIR)/fmfconv_compr.Po -rm -f ./$(DEPDIR)/fmfconv_types.Po -rm -f ./$(DEPDIR)/ide.Po -rm -f ./$(DEPDIR)/keys.Po -rm -f ./$(DEPDIR)/listbasic.Po -rm -f ./$(DEPDIR)/mdrlist.Po -rm -f ./$(DEPDIR)/profile2map.Po -rm -f ./$(DEPDIR)/raw2hdf.Po -rm -f ./$(DEPDIR)/rzxcheck.Po -rm -f ./$(DEPDIR)/rzxdump.Po -rm -f ./$(DEPDIR)/rzxtool.Po -rm -f ./$(DEPDIR)/scl2trd.Po -rm -f ./$(DEPDIR)/snap2tzx.Po -rm -f ./$(DEPDIR)/snapconv.Po -rm -f ./$(DEPDIR)/snapdump.Po -rm -f ./$(DEPDIR)/tape2pulses.Po -rm -f ./$(DEPDIR)/tape2wav.Po -rm -f ./$(DEPDIR)/tapeconv.Po -rm -f ./$(DEPDIR)/tzxlist.Po -rm -f ./$(DEPDIR)/utils.Po -rm -f compat/$(DEPDIR)/getopt.Po -rm -f compat/$(DEPDIR)/getopt1.Po -rm -f compat/amiga/$(DEPDIR)/basename.Po -rm -f compat/amiga/$(DEPDIR)/osname.Po -rm -f compat/unix/$(DEPDIR)/basename.Po -rm -f compat/unix/$(DEPDIR)/osname.Po -rm -f compat/win32/$(DEPDIR)/osname.Po -rm -f converter/$(DEPDIR)/audio2tape-findpilot.Po -rm -f converter/$(DEPDIR)/audio2tape-findsync1.Po -rm -f converter/$(DEPDIR)/audio2tape-getpulse1.Po -rm -f converter/$(DEPDIR)/audio2tape-getpulse2.Po -rm -f converter/$(DEPDIR)/audio2tape-getsync2.Po -rm -f converter/$(DEPDIR)/audio2tape-romloader.Po -rm -f converter/$(DEPDIR)/audio2tape-romloaderstate.Po -rm -f fmfconv_output/$(DEPDIR)/fmfconv_aiff.Po -rm -f fmfconv_output/$(DEPDIR)/fmfconv_au.Po -rm -f fmfconv_output/$(DEPDIR)/fmfconv_avi.Po -rm -f fmfconv_output/$(DEPDIR)/fmfconv_jpg.Po -rm -f fmfconv_output/$(DEPDIR)/fmfconv_png.Po -rm -f fmfconv_output/$(DEPDIR)/fmfconv_ppm.Po -rm -f fmfconv_output/$(DEPDIR)/fmfconv_scr.Po -rm -f fmfconv_output/$(DEPDIR)/fmfconv_wav.Po -rm -f fmfconv_output/$(DEPDIR)/fmfconv_yuv.Po -rm -f importer/$(DEPDIR)/audio2tape-soundfile.Po -rm -f importer/$(DEPDIR)/audio2tape-trigger.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f ./$(DEPDIR)/audio2tape-audio2tape.Po -rm -f ./$(DEPDIR)/audio2tape-utils.Po -rm -f ./$(DEPDIR)/createhdf.Po -rm -f ./$(DEPDIR)/fmfconv.Po -rm -f ./$(DEPDIR)/fmfconv_compr.Po -rm -f ./$(DEPDIR)/fmfconv_types.Po -rm -f ./$(DEPDIR)/ide.Po -rm -f ./$(DEPDIR)/keys.Po -rm -f ./$(DEPDIR)/listbasic.Po -rm -f ./$(DEPDIR)/mdrlist.Po -rm -f ./$(DEPDIR)/profile2map.Po -rm -f ./$(DEPDIR)/raw2hdf.Po -rm -f ./$(DEPDIR)/rzxcheck.Po -rm -f ./$(DEPDIR)/rzxdump.Po -rm -f ./$(DEPDIR)/rzxtool.Po -rm -f ./$(DEPDIR)/scl2trd.Po -rm -f ./$(DEPDIR)/snap2tzx.Po -rm -f ./$(DEPDIR)/snapconv.Po -rm -f ./$(DEPDIR)/snapdump.Po -rm -f ./$(DEPDIR)/tape2pulses.Po -rm -f ./$(DEPDIR)/tape2wav.Po -rm -f ./$(DEPDIR)/tapeconv.Po -rm -f ./$(DEPDIR)/tzxlist.Po -rm -f ./$(DEPDIR)/utils.Po -rm -f compat/$(DEPDIR)/getopt.Po -rm -f compat/$(DEPDIR)/getopt1.Po -rm -f compat/amiga/$(DEPDIR)/basename.Po -rm -f compat/amiga/$(DEPDIR)/osname.Po -rm -f compat/unix/$(DEPDIR)/basename.Po -rm -f compat/unix/$(DEPDIR)/osname.Po -rm -f compat/win32/$(DEPDIR)/osname.Po -rm -f converter/$(DEPDIR)/audio2tape-findpilot.Po -rm -f converter/$(DEPDIR)/audio2tape-findsync1.Po -rm -f converter/$(DEPDIR)/audio2tape-getpulse1.Po -rm -f converter/$(DEPDIR)/audio2tape-getpulse2.Po -rm -f converter/$(DEPDIR)/audio2tape-getsync2.Po -rm -f converter/$(DEPDIR)/audio2tape-romloader.Po -rm -f converter/$(DEPDIR)/audio2tape-romloaderstate.Po -rm -f fmfconv_output/$(DEPDIR)/fmfconv_aiff.Po -rm -f fmfconv_output/$(DEPDIR)/fmfconv_au.Po -rm -f fmfconv_output/$(DEPDIR)/fmfconv_avi.Po -rm -f fmfconv_output/$(DEPDIR)/fmfconv_jpg.Po -rm -f fmfconv_output/$(DEPDIR)/fmfconv_png.Po -rm -f fmfconv_output/$(DEPDIR)/fmfconv_ppm.Po -rm -f fmfconv_output/$(DEPDIR)/fmfconv_scr.Po -rm -f fmfconv_output/$(DEPDIR)/fmfconv_wav.Po -rm -f fmfconv_output/$(DEPDIR)/fmfconv_yuv.Po -rm -f importer/$(DEPDIR)/audio2tape-soundfile.Po -rm -f importer/$(DEPDIR)/audio2tape-trigger.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: all check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles am--refresh check \ check-am check-local clean clean-binPROGRAMS clean-cscope \ clean-generic clean-libtool clean-noinstLIBRARIES cscope \ cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-bzip3 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \ dist-zip dist-zstd distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-man \ uninstall-man1 .PRECIOUS: Makefile @COMPAT_WIN32_TRUE@install-win32: all @COMPAT_WIN32_TRUE@ test -n "$(DESTDIR)" || { echo "ERROR: set DESTDIR path"; exit 1; } @COMPAT_WIN32_TRUE@ $(MKDIR_P) $(DESTDIR)/ || exit 1 # Copy executables @COMPAT_WIN32_TRUE@ list='$(bin_PROGRAMS)'; \ @COMPAT_WIN32_TRUE@ for file in $$list; do \ @COMPAT_WIN32_TRUE@ if test -f "$(top_builddir)/.libs/$$file"; then \ @COMPAT_WIN32_TRUE@ cp "$(top_builddir)/.libs/$$file" $(DESTDIR); \ @COMPAT_WIN32_TRUE@ else \ @COMPAT_WIN32_TRUE@ cp "$(top_builddir)/$$file" $(DESTDIR); \ @COMPAT_WIN32_TRUE@ fi; \ @COMPAT_WIN32_TRUE@ done # Copy required DLLs from sysroot, following DLL dependencies recursively. # Only scan shipped top-level binaries. @COMPAT_WIN32_TRUE@ bash "$(top_srcdir)/compat/win32/check_win32_dll_deps.sh" "$(DESTDIR)" # Get text files @COMPAT_WIN32_TRUE@ for file in AUTHORS ChangeLog COPYING README; \ @COMPAT_WIN32_TRUE@ do cp "$(top_srcdir)/$$file" "$(DESTDIR)/$$file.txt"; \ @COMPAT_WIN32_TRUE@ done # Get manuals @COMPAT_WIN32_TRUE@ topsrcdirstrip=`echo "$(top_srcdir)/man" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @COMPAT_WIN32_TRUE@ man_files=`for file in $(top_srcdir)/man/*.1; do echo "$$file"; done | \ @COMPAT_WIN32_TRUE@ sed -e "s|^$$topsrcdirstrip/||" -e "s|.1$$||"`; \ @COMPAT_WIN32_TRUE@ for file in $$man_files; do \ @COMPAT_WIN32_TRUE@ if test -n "$(GROFF)"; then \ @COMPAT_WIN32_TRUE@ $(GROFF) -Thtml -man "$(top_srcdir)/man/$$file.1" > "$(DESTDIR)/$$file.html"; \ @COMPAT_WIN32_TRUE@ elif test -n "$(MAN2HTML)"; then \ @COMPAT_WIN32_TRUE@ $(MAN2HTML) -r "$(top_srcdir)/man/$$file.1" | \ @COMPAT_WIN32_TRUE@ sed '1d' > "$(DESTDIR)/$$file.html"; \ @COMPAT_WIN32_TRUE@ fi; \ @COMPAT_WIN32_TRUE@ done # Convert to DOS line endings @COMPAT_WIN32_TRUE@ test -z "$(UNIX2DOS)" || find $(DESTDIR) -type f \( -name "*txt" -or -name "*html" \) -exec $(UNIX2DOS) -q {} \; @COMPAT_WIN32_TRUE@install-win32-strip: install-win32 @COMPAT_WIN32_TRUE@ test -z "$(STRIP)" || { list='$(bin_PROGRAMS)'; \ @COMPAT_WIN32_TRUE@ for file in $$list; do \ @COMPAT_WIN32_TRUE@ test -z "$(STRIP)" || $(STRIP) "$(DESTDIR)/$$file"; \ @COMPAT_WIN32_TRUE@ done } @COMPAT_WIN32_TRUE@dist-win32-dir: @COMPAT_WIN32_TRUE@ $(MAKE) DESTDIR="$(top_win32dir)" install-win32-strip @COMPAT_WIN32_TRUE@dist-win32-zip: dist-win32-dir @COMPAT_WIN32_TRUE@ rm -f -- $(top_builddir)/$(package_win32).zip @COMPAT_WIN32_TRUE@ rm -f -- $(top_builddir)/$(package_win32).zip.sha1 @COMPAT_WIN32_TRUE@ test -n "$(top_win32dir)" || exit 1 @COMPAT_WIN32_TRUE@ @test `find $(top_win32dir) -type f -name \*.dll -print | wc -l` -ne 0 || \ @COMPAT_WIN32_TRUE@ { echo "ERROR: external libraries not found in $(top_win32dir). Please, manually copy them."; exit 1; } @COMPAT_WIN32_TRUE@ cd $(top_win32dir) && \ @COMPAT_WIN32_TRUE@ zip -q -9 -r $(abs_top_builddir)/$(package_win32).zip . @COMPAT_WIN32_TRUE@ -sha1sum $(top_builddir)/$(package_win32).zip > $(top_builddir)/$(package_win32).zip.sha1 && \ @COMPAT_WIN32_TRUE@ { test -z "$(UNIX2DOS)" || $(UNIX2DOS) $(top_builddir)/$(package_win32).zip.sha1; } @COMPAT_WIN32_TRUE@dist-win32-7z: dist-win32-dir @COMPAT_WIN32_TRUE@ rm -f -- $(top_builddir)/$(package_win32).7z @COMPAT_WIN32_TRUE@ rm -f -- $(top_builddir)/$(package_win32).7z.sha1 @COMPAT_WIN32_TRUE@ test -n "$(top_win32dir)" || exit 1 @COMPAT_WIN32_TRUE@ @test `find $(top_win32dir) -type f -name \*.dll -print | wc -l` -ne 0 || \ @COMPAT_WIN32_TRUE@ { echo "ERROR: external libraries not found in $(top_win32dir). Please, manually copy them."; exit 1; } @COMPAT_WIN32_TRUE@ cd $(top_win32dir) && \ @COMPAT_WIN32_TRUE@ 7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on -bd $(abs_top_builddir)/$(package_win32).7z . @COMPAT_WIN32_TRUE@ -sha1sum $(top_builddir)/$(package_win32).7z > $(top_builddir)/$(package_win32).7z.sha1 && \ @COMPAT_WIN32_TRUE@ { test -z "$(UNIX2DOS)" || $(UNIX2DOS) $(top_builddir)/$(package_win32).7z.sha1; } @COMPAT_WIN32_TRUE@dist-win32: dist-win32-zip dist-win32-7z @COMPAT_WIN32_TRUE@distclean-win32: @COMPAT_WIN32_TRUE@ if test -d "$(top_builddir)/$(package_win32)"; then \ @COMPAT_WIN32_TRUE@ rm -rf -- "$(top_builddir)/$(package_win32)"; \ @COMPAT_WIN32_TRUE@ fi @COMPAT_WIN32_TRUE@ rm -f -- $(top_builddir)/$(package_win32).zip @COMPAT_WIN32_TRUE@ rm -f -- $(top_builddir)/$(package_win32).zip.sha1 @COMPAT_WIN32_TRUE@ rm -f -- $(top_builddir)/$(package_win32).7z @COMPAT_WIN32_TRUE@ rm -f -- $(top_builddir)/$(package_win32).7z.sha1 @COMPAT_WIN32_TRUE@.PHONY: install-win32 install-win32-strip \ @COMPAT_WIN32_TRUE@ dist-win32 dist-win32-dir dist-win32-zip dist-win32-7z distclean-win32 check-local: UTILS_TEST_SRCDIR=$(srcdir) \ UTILS_TEST_TOPBUILDDIR=$(top_builddir) \ sh $(srcdir)/tests/tapeconv_roundtrip.sh UTILS_TEST_SRCDIR=$(srcdir) \ UTILS_TEST_TOPBUILDDIR=$(top_builddir) \ sh $(srcdir)/tests/snapconv_roundtrip.sh UTILS_TEST_SRCDIR=$(srcdir) \ UTILS_TEST_TOPBUILDDIR=$(top_builddir) \ sh $(srcdir)/tests/tzxlist_listing.sh @HAVE_WINDRES_TRUE@.rc.o: @HAVE_WINDRES_TRUE@ $(AM_V_GEN)$(WINDRES) -I$(srcdir) -I$(top_builddir) $(LIBSPECTRUM_CFLAGS) $(CPPFLAGS) -o $@ $< # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% fuse-utils-1.5.1/tape2wav_res.rc0000664000175000017500000000364415157611610015576 0ustar00fredmfredm/* tape2wav_res.rc: resources for Windows executable Copyright (c) 2015 Sergio Baldovi 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. Author contact information: E-mail: serbalgi@gmail.com */ #include "config.h" #include /* VERSIONINFO specs: http://msdn.microsoft.com/en-us/library/aa381058%28VS.85%29.aspx */ VS_VERSION_INFO VERSIONINFO FILEVERSION FUSE_UTILS_RC_VERSION PRODUCTVERSION FUSE_UTILS_RC_VERSION FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0x0L FILEOS VOS__WINDOWS32 FILETYPE VFT_APP FILESUBTYPE VFT2_UNKNOWN BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904B0" BEGIN VALUE "CompanyName", "\0" VALUE "FileDescription", "ZX Spectrum tape to wav audio file converter\0" VALUE "FileVersion", VERSION##"\0" VALUE "InternalName", "tape2wav\0" VALUE "LegalCopyright", "Copyright (c) 2007 Fredrick Meunier\0" VALUE "License", "tape2wav is licensed under the GNU General Public License, version 2 or later\0" VALUE "OriginalFilename", "tape2wav.exe\0" VALUE "ProductName", PACKAGE##"\0" VALUE "ProductVersion", VERSION##"\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1252 END END fuse-utils-1.5.1/listbasic_res.rc0000664000175000017500000000372615157611610016023 0ustar00fredmfredm/* listbasic_res.rc: resources for Windows executable Copyright (c) 2015 Sergio Baldovi 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. Author contact information: E-mail: serbalgi@gmail.com */ #include "config.h" #include /* VERSIONINFO specs: http://msdn.microsoft.com/en-us/library/aa381058%28VS.85%29.aspx */ VS_VERSION_INFO VERSIONINFO FILEVERSION FUSE_UTILS_RC_VERSION PRODUCTVERSION FUSE_UTILS_RC_VERSION FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0x0L FILEOS VOS__WINDOWS32 FILETYPE VFT_APP FILESUBTYPE VFT2_UNKNOWN BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904B0" BEGIN VALUE "CompanyName", "\0" VALUE "FileDescription", "Extract the BASIC from a ZX Spectrum file\0" VALUE "FileVersion", VERSION##"\0" VALUE "InternalName", "listbasic\0" VALUE "LegalCopyright", "Copyright (c) 2002 Chris Cowley, 2003 Philip Kendall, Darren Salt, 2007 Stuart Brady\0" VALUE "License", "listbasic is licensed under the GNU General Public License, version 2 or later\0" VALUE "OriginalFilename", "listbasic.exe\0" VALUE "ProductName", PACKAGE##"\0" VALUE "ProductVersion", VERSION##"\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1252 END END fuse-utils-1.5.1/rzxdump.c0000664000175000017500000004115315253737163014531 0ustar00fredmfredm/* rzxdump.c: get info on an RZX file Copyright (c) 2002-2015 Philip Kendall, Sergio Baldovi 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. Author contact information: E-mail: philip-fuse@shadowmagic.org.uk */ #include "config.h" #include #include #include #include #include #include #include #include #include #ifdef HAVE_GCRYPT_H #include #endif /* #ifdef HAVE_GCRYPT_H */ #include "libspectrum.h" #include "compat.h" #include "utils.h" #define PROGRAM_NAME "rzxdump" char *progname; const char *rzx_signature = "RZX!"; size_t block_number; static int dump_snapshots = 0; static libspectrum_rzx *rzx; static size_t input_block_number; libspectrum_word read_word( unsigned char **ptr ); libspectrum_dword read_dword( unsigned char **ptr ); static int do_file( const char *filename ); static int read_creator_block( unsigned char **ptr, unsigned char *end ); static int read_snapshot_block( unsigned char **ptr, unsigned char *end, const char *rzx_filename ); static int read_input_block( unsigned char **ptr, unsigned char *end ); static int read_sign_start_block( unsigned char **ptr, unsigned char *end ); static int read_sign_end_block( unsigned char **ptr, unsigned char *end ); libspectrum_word read_word( unsigned char **ptr ) { libspectrum_word result = (*ptr)[0] + (*ptr)[1] * 0x100; (*ptr) += 2; return result; } libspectrum_dword read_dword( unsigned char **ptr ) { libspectrum_dword result = (*ptr)[0] + (*ptr)[1] * 0x100 + (*ptr)[2] * 0x10000 + (*ptr)[3] * 0x1000000; (*ptr) += 4; return result; } static void show_version( void ) { printf( PROGRAM_NAME " (" PACKAGE ") " PACKAGE_VERSION "\n" "Copyright (c) 2002-2014 Philip Kendall\n" "License GPLv2+: GNU GPL version 2 or later " "\n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" ); } static void show_help( void ) { printf( "Usage: %s [OPTION] ...\n" "List contents of Sinclair ZX Spectrum input recording files.\n" "\n" "Options:\n" " -s Dump snapshots to files.\n" " -h, --help Display this help and exit.\n" " -V, --version Output version information and exit.\n" "\n" "Report %s bugs to <%s>\n" "%s home page: <%s>\n" "For complete documentation, see the manual page of %s.\n", progname, PROGRAM_NAME, PACKAGE_BUGREPORT, PACKAGE_NAME, PACKAGE_URL, PROGRAM_NAME ); } int main( int argc, char **argv ) { int i, c; int error = 0; struct option long_options[] = { { "help", 0, NULL, 'h' }, { "version", 0, NULL, 'V' }, { 0, 0, 0, 0 } }; progname = argv[0]; error = init_libspectrum(); if( error ) return error; while( ( c = getopt_long( argc, argv, "shV", long_options, NULL ) ) != -1 ) { switch( c ) { case 's': dump_snapshots = 1; break; case 'h': show_help(); return 0; case 'V': show_version(); return 0; case '?': /* getopt prints an error message to stderr */ error = 1; break; default: error = 1; fprintf( stderr, "%s: unknown option `%c'\n", progname, (char) c ); break; } } argc -= optind; argv += optind; if( error ) { fprintf( stderr, "Try `%s --help' for more information.\n", progname ); return error; } if( argc < 1 ) { fprintf( stderr, "%s: Usage: %s [OPTION] ...\n", progname, progname ); fprintf( stderr, "Try `%s --help' for more information.\n", progname ); return 1; } for( i = 0; i < argc; i++ ) { error = do_file( argv[i] ); if( error ) return error; } return 0; } static int do_file( const char *filename ) { libspectrum_file file; unsigned char *ptr, *end; int error; rzx = NULL; printf( "Examining file %s\n", filename ); error = read_file( filename, &file ); if( error ) return error; rzx = libspectrum_rzx_alloc(); error = libspectrum_rzx_read( rzx, file.buffer, file.length ); if( error ) { libspectrum_rzx_free( rzx ); libspectrum_file_clear( &file ); return error; } ptr = file.buffer; end = file.buffer + file.length; /* Read the RZX header */ if( end - ptr < (ptrdiff_t)strlen( rzx_signature ) + 6 ) { fprintf( stderr, "%s: Not enough bytes for RZX header (%lu bytes)\n", progname, (unsigned long)strlen( rzx_signature ) + 6 ); libspectrum_rzx_free( rzx ); libspectrum_file_clear( &file ); return 1; } if( memcmp( ptr, rzx_signature, strlen( rzx_signature ) ) ) { fprintf( stderr, "%s: Wrong signature: expected `%s'\n", progname, rzx_signature ); libspectrum_rzx_free( rzx ); libspectrum_file_clear( &file ); return 1; } printf( "Found RZX signature\n" ); ptr += strlen( rzx_signature ); block_number = 0; input_block_number = 0; printf( " Major version: %d\n", (int)*ptr++ ); printf( " Minor version: %d\n", (int)*ptr++ ); printf( " Flags: %d\n", read_dword( &ptr ) ); while( ptr < end ) { unsigned char id; id = *ptr++; switch( id ) { case 0x10: error = read_creator_block( &ptr, end ); break; case 0x20: error = read_sign_start_block( &ptr, end ); break; case 0x21: error = read_sign_end_block( &ptr, end ); break; case 0x30: error = read_snapshot_block( &ptr, end, file.filename ); break; case 0x80: error = read_input_block( &ptr, end ); break; default: fprintf( stderr, "%s: Unknown block type 0x%02x at offset %ld\n", progname, id, (long)( ptr - file.buffer - 1 ) ); libspectrum_rzx_free( rzx ); libspectrum_file_clear( &file ); return 1; } if( error ) { libspectrum_rzx_free( rzx ); libspectrum_file_clear( &file ); return 1; } } libspectrum_rzx_free( rzx ); rzx = NULL; libspectrum_file_clear( &file ); return 0; } static void print_canonical_version( const char *creator, libspectrum_word major_version, libspectrum_word minor_version ) { printf( " Creator canonical version: " ); if( !strncmp( creator, "Fuse", strlen( "Fuse" ) ) || !strncmp( creator, "rzxtool", strlen( "rzxtool" ) )) { printf( "%d.%d.%d.%d\n", major_version / 0x100, major_version % 0x100, minor_version / 0x100, minor_version % 0x100 ); } else if( !strncmp( creator, "Spectaculator", strlen( "Spectaculator" ) ) ) { printf( "%d.%d.%d\n", major_version / 10, major_version % 10, minor_version ); } else if( !strncmp( creator, "RealSpectrum", strlen( "RealSpectrum" ) ) ) { printf( "%x.%x\n", major_version, minor_version ); } else { /* Simple decimal version (EmuZWin, SpecEmu, SPIN) */ printf( "%d.%d\n", major_version, minor_version ); } } static int read_creator_block( unsigned char **ptr, unsigned char *end ) { const libspectrum_creator *rzx_creator; const char *program; size_t length; libspectrum_word major_version, minor_version; if( end - *ptr < 28 ) { fprintf( stderr, "%s: Not enough bytes for creator block\n", progname ); return 1; } printf( "Found a creator block\n" ); length = read_dword( ptr ); printf( " Length: %lu bytes\n", (unsigned long)length ); rzx_creator = libspectrum_rzx_creator( rzx ); if( !rzx_creator ) { fprintf( stderr, "%s: creator block has no metadata\n", progname ); return 1; } program = libspectrum_creator_program( rzx_creator ); major_version = libspectrum_creator_major( rzx_creator ); minor_version = libspectrum_creator_minor( rzx_creator ); printf( " Creator: `%s'\n", program ); printf( " Creator major version: %d\n", major_version ); printf( " Creator minor version: %d\n", minor_version ); print_canonical_version( program, major_version, minor_version ); printf( " Creator custom data: %lu bytes\n", (unsigned long)libspectrum_creator_custom_length( rzx_creator ) ); (*ptr) += length - 5; return 0; } static void print_ascii_string( unsigned char *data, size_t length ) { unsigned int i; for( i = 0; i < length; i++) { unsigned char c; if( data[i] >= 32 && data[i] < 127 ) { c = data[i]; } else { c = '?'; } printf( "%c", c ); } } static char * get_snap_filename( const char *rzx_archive, const char *extension, size_t number ) { char *buffer, *buffer2, *last_dot, *snap_filename; size_t snap_filename_len; /* Get the basename without the last extension */ buffer = strdup( rzx_archive ); if( !buffer ) { fprintf( stderr, "out of memory at %s:%d", __FILE__, __LINE__ ); return NULL; } buffer2 = compat_basename( buffer ); last_dot = strrchr( buffer2, '.' ); if( last_dot ) *last_dot = '\0'; snap_filename_len = strlen( buffer2 ) + 16; snap_filename = libspectrum_new( char, snap_filename_len ); if( extension ) snprintf( snap_filename, snap_filename_len, "%s_%lu.%s", buffer2, (unsigned long)number, extension ); else snprintf( snap_filename, snap_filename_len, "%s_%lu", buffer2, (unsigned long)number ); free( buffer ); return snap_filename; } static void write_snapshot( const char *filename, const unsigned char *buffer, size_t length, int compressed ) { libspectrum_error error; if( !compressed ) { write_file( filename, buffer, length ); } else { #ifdef LIBSPECTRUM_SUPPORTS_ZLIB_COMPRESSION size_t new_length = 0; libspectrum_byte *new_buffer = NULL; error = libspectrum_zlib_inflate( buffer, length, &new_buffer, &new_length ); if( !error ) { write_file( filename, new_buffer, new_length ); libspectrum_free( new_buffer ); } #else fprintf( stderr, "%s: zlib not available to decompress snapshot %s\n", progname, filename ); #endif } } static int read_snapshot_block( unsigned char **ptr, unsigned char *end, const char *rzx_filename ) { size_t block_length, path_length; libspectrum_dword flags; char *snap_filename, *snap_extension; if( end - *ptr < 16 ) { fprintf( stderr, "%s: Not enough bytes for snapshot block\n", progname ); return 1; } printf( "Found a snapshot block\n" ); printf( " Block: %lu\n", (unsigned long)block_number ); block_number++; block_length = read_dword( ptr ); printf( " Length: %lu bytes\n", (unsigned long)block_length ); flags = read_dword( ptr ); printf( " Flags: %lu\n", (unsigned long)flags ); snap_extension = (char *) *ptr; printf( " Snapshot extension: `%s'\n", snap_extension ); (*ptr) += 4; printf( " Snap length: %d bytes\n", read_dword( ptr ) ); /* Snapshot descriptor */ if( ( flags & 0x03 ) == 1 ) { if( end - *ptr < 5 ) { fprintf( stderr, "%s: Not enough bytes for snapshot block\n", progname ); return 1; } printf( " Checksum: 0x%08x\n", read_dword( ptr ) ); printf( " Snap path: " ); path_length = block_length - 17 - 4; print_ascii_string( *ptr, path_length - 1 ); printf( "\n" ); (*ptr) += path_length; return 0; } /* Snapshot data */ if( dump_snapshots ) { snap_filename = get_snap_filename( rzx_filename, snap_extension, block_number - 1 ); write_snapshot( snap_filename, *ptr, block_length - 17, flags & 0x02 ); free( snap_filename ); } (*ptr) += block_length - 17; return 0; } static int read_input_block( unsigned char **ptr, unsigned char *end ) { size_t i, frames, length; int flags; if( end - *ptr < 17 ) { fprintf( stderr, "%s: Not enough bytes for input recording block\n", progname ); return 1; } printf( "Found an input recording block\n" ); printf( " Block: %lu\n", (unsigned long)block_number ); block_number++; length = read_dword( ptr ); printf( " Length: %lu bytes\n", (unsigned long)length ); frames = read_dword( ptr ); printf( " Frame count: %lu\n", (unsigned long)frames ); printf( " Frame length (obsolete): %d bytes\n", *(*ptr)++ ); printf( " Tstate counter: %d\n", read_dword( ptr ) ); flags = read_dword( ptr ); printf( " Flags: %d\n", flags ); /* Check there's enough data */ if( end - *ptr < (off_t)length - 18 ) { fprintf( stderr, "%s: not enough frame data\n", progname ); return 1; } if( flags & 0x02 ) { /* Data is compressed */ libspectrum_snap *snap; int finished; libspectrum_error error; error = libspectrum_rzx_start_playback( rzx, input_block_number, &snap ); if( error ) return error; for( i = 0; i < frames; i++ ) { printf( "Examining frame %lu\n", (unsigned long)i ); printf( " Instruction count: %lu\n", (unsigned long)libspectrum_rzx_instructions( rzx ) ); printf( " IN count: %lu\n", (unsigned long) libspectrum_rzx_playback_inputs_remaining( rzx ) ); error = libspectrum_rzx_playback_discard_inputs( rzx ); if( error ) return error; error = libspectrum_rzx_playback_frame( rzx, &finished, &snap ); if( error ) return error; } (*ptr) += length - 18; } else { /* Data is not compressed */ for( i=0; i, 1996 # Copyright (C) 1996-2019, 2021-2024 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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, see . PROGRAM=libtool PACKAGE=libtool VERSION="2.5.4 Debian-2.5.4-9" package_revision=2.5.4 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2024-12-01.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2004-2019, 2021, 2023-2024 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # These NLS vars are set unconditionally (bootstrap issue #24). Unset those # in case the environment reset is needed later and the $save_* variant is not # defined (see the code above). LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # func_unset VAR # -------------- # Portably unset VAR. # In some shells, an 'unset VAR' statement leaves a non-zero return # status if VAR is already unset, which might be problematic if the # statement is used at the end of a function (thus poisoning its return # value) or when 'set -e' is active (causing even a spurious abort of # the script in this case). func_unset () { { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } } # Make sure CDPATH doesn't cause `cd` commands to output the target dir. func_unset CDPATH # Make sure ${,E,F}GREP behave sanely. func_unset GREP_OPTIONS ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" # require_check_ifs_backslash # --------------------------- # Check if we can use backslash as IFS='\' separator, and set # $check_ifs_backshlash_broken to ':' or 'false'. require_check_ifs_backslash=func_require_check_ifs_backslash func_require_check_ifs_backslash () { _G_save_IFS=$IFS IFS='\' _G_check_ifs_backshlash='a\\b' for _G_i in $_G_check_ifs_backshlash do case $_G_i in a) check_ifs_backshlash_broken=false ;; '') break ;; *) check_ifs_backshlash_broken=: break ;; esac done IFS=$_G_save_IFS require_check_ifs_backslash=: } ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # usable or anything else if it does not work. if test -z "$_G_HAVE_PLUSEQ_OP" && \ __PLUSEQ_TEST="a" && \ __PLUSEQ_TEST+=" b" 2>/dev/null && \ test "a b" = "$__PLUSEQ_TEST"; then _G_HAVE_PLUSEQ_OP=yes fi if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1=\$$1\\ \$func_quote_arg_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value returned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list in case some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_portable EVAL ARG # ---------------------------- # Internal function to portably implement func_quote_arg. Note that we still # keep attention to performance here so we as much as possible try to avoid # calling sed binary (so far O(N) complexity as long as func_append is O(1)). func_quote_portable () { $debug_cmd $require_check_ifs_backslash func_quote_portable_result=$2 # one-time-loop (easy break) while true do if $1; then func_quote_portable_result=`$ECHO "$2" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` break fi # Quote for eval. case $func_quote_portable_result in *[\\\`\"\$]*) # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string # contains the shell wildcard characters. case $check_ifs_backshlash_broken$func_quote_portable_result in :*|*[\[\*\?]*) func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ | $SED "$sed_quote_subst"` break ;; esac func_quote_portable_old_IFS=$IFS for _G_char in '\' '`' '"' '$' do # STATE($1) PREV($2) SEPARATOR($3) set start "" "" func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy IFS=$_G_char for _G_part in $func_quote_portable_result do case $1 in quote) func_append func_quote_portable_result "$3$2" set quote "$_G_part" "\\$_G_char" ;; start) set first "" "" func_quote_portable_result= ;; first) set quote "$_G_part" "" ;; esac done done IFS=$func_quote_portable_old_IFS ;; *) ;; esac break done func_quote_portable_unquoted_result=$func_quote_portable_result case $func_quote_portable_result in # double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # many bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_portable_result=\"$func_quote_portable_result\" ;; esac } # func_quotefast_eval ARG # ----------------------- # Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', # but optimized for speed. Result is stored in $func_quotefast_eval. if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then printf -v _GL_test_printf_tilde %q '~' if test '\~' = "$_GL_test_printf_tilde"; then func_quotefast_eval () { printf -v func_quotefast_eval_result %q "$1" } else # Broken older Bash implementations. Make those faster too if possible. func_quotefast_eval () { case $1 in '~'*) func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result ;; *) printf -v func_quotefast_eval_result %q "$1" ;; esac } fi else func_quotefast_eval () { func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result } fi # func_quote_arg MODEs ARG # ------------------------ # Quote one ARG to be evaled later. MODEs argument may contain zero or more # specifiers listed below separated by ',' character. This function returns two # values: # i) func_quote_arg_result # double-quoted (when needed), suitable for a subsequent eval # ii) func_quote_arg_unquoted_result # has all characters that are still active within double # quotes backslashified. Available only if 'unquoted' is specified. # # Available modes: # ---------------- # 'eval' (default) # - escape shell special characters # 'expand' # - the same as 'eval'; but do not quote variable references # 'pretty' # - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might # be used later in func_quote to get output like: 'echo "a b"' instead # of 'echo a\ b'. This is slower than default on some shells. # 'unquoted' # - produce also $func_quote_arg_unquoted_result which does not contain # wrapping double-quotes. # # Examples for 'func_quote_arg pretty,unquoted string': # # string | *_result | *_unquoted_result # ------------+-----------------------+------------------- # " | \" | \" # a b | "a b" | a b # "a b" | "\"a b\"" | \"a b\" # * | "*" | * # z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" # # Examples for 'func_quote_arg pretty,unquoted,expand string': # # string | *_result | *_unquoted_result # --------------+---------------------+-------------------- # z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" func_quote_arg () { _G_quote_expand=false case ,$1, in *,expand,*) _G_quote_expand=: ;; esac case ,$1, in *,pretty,*|*,expand,*|*,unquoted,*) func_quote_portable $_G_quote_expand "$2" func_quote_arg_result=$func_quote_portable_result func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result ;; *) # Faster quote-for-eval for some shells. func_quotefast_eval "$2" func_quote_arg_result=$func_quotefast_eval_result ;; esac } # func_quote MODEs ARGs... # ------------------------ # Quote all ARGs to be evaled later and join them into single command. See # func_quote_arg's description for more info. func_quote () { $debug_cmd _G_func_quote_mode=$1 ; shift func_quote_result= while test 0 -lt $#; do func_quote_arg "$_G_func_quote_mode" "$1" if test -n "$func_quote_result"; then func_append func_quote_result " $func_quote_arg_result" else func_append func_quote_result "$func_quote_arg_result" fi shift done } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_arg pretty,expand "$_G_cmd" eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_arg expand,pretty "$_G_cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2010-2019, 2021, 2023-2024 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # # Set a version string for this script. scriptversion=2019-02-19.15; # UTC ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # in the main code. A hook is just a list of function names that can be # run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of hook functions to be called by # FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_propagate_result FUNC_NAME_A FUNC_NAME_B # --------------------------------------------- # If the *_result variable of FUNC_NAME_A _is set_, assign its value to # *_result variable of FUNC_NAME_B. func_propagate_result () { $debug_cmd func_propagate_result_result=: if eval "test \"\${${1}_result+set}\" = set" then eval "${2}_result=\$${1}_result" else func_propagate_result_result=false fi } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd _G_rc_run_hooks=false case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do func_unset "${_G_hook}_result" eval $_G_hook '${1+"$@"}' func_propagate_result $_G_hook func_run_hooks if $func_propagate_result_result; then eval set dummy "$func_run_hooks_result"; shift fi done } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list from your hook function. You may remove # or edit any options that you action, and then pass back the remaining # unprocessed options in '_result', escaped # suitably for 'eval'. # # The '_result' variable is automatically unset # before your hook gets called; for best performance, only set the # *_result variable when necessary (i.e. don't call the 'func_quote' # function unnecessarily because it can be an expensive operation on some # machines). # # Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # No change in '$@' (ignored completely by this hook). Leave # # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # args_changed=false # # # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: # args_changed=: # ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # args_changed=: # ;; # *) # Make sure the first unrecognised option "$_G_opt" # # is added back to "$@" in case we need it later, # # if $args_changed was set to 'true'. # set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # # # Only call 'func_quote' here if we processed at least one argument. # if $args_changed; then # func_quote eval ${1+"$@"} # my_silent_option_result=$func_quote_result # fi # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # } # func_add_hook func_validate_options my_option_validation # # You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options_finish [ARG]... # ---------------------------- # Finishing the option parse loop (call 'func_options' hooks ATM). func_options_finish () { $debug_cmd func_run_hooks func_options ${1+"$@"} func_propagate_result func_run_hooks func_options_finish } # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd _G_options_quoted=false for my_func in options_prep parse_options validate_options options_finish do func_unset func_${my_func}_result func_unset func_run_hooks_result eval func_$my_func '${1+"$@"}' func_propagate_result func_$my_func func_options if $func_propagate_result_result; then eval set dummy "$func_options_result"; shift _G_options_quoted=: fi done $_G_options_quoted || { # As we (func_options) are top-level options-parser function and # nobody quoted "$@" for us yet, we need to do it explicitly for # caller. func_quote eval ${1+"$@"} func_options_result=$func_quote_result } } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propagate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} func_propagate_result func_run_hooks func_options_prep } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} func_propagate_result func_run_hooks func_parse_options if $func_propagate_result_result; then eval set dummy "$func_parse_options_result"; shift # Even though we may have changed "$@", we passed the "$@" array # down into the hook and it quoted it for us (because we are in # this if-branch). No need to quote it again. _G_parse_options_requote=false fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break # We expect that one of the options parsed in this function matches # and thus we remove _G_opt from "$@" and need to re-quote. _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" >&2 $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) if test $# = 0 && func_missing_arg $_G_opt; then _G_parse_options_requote=: break fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift _G_match_parse_options=false break ;; esac if $_G_match_parse_options; then _G_parse_options_requote=: fi done if $_G_parse_options_requote; then # save modified positional parameters for caller func_quote eval ${1+"$@"} func_parse_options_result=$func_quote_result fi } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables # after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} if test "x$func_split_equals_lhs" = "x$1"; then func_split_equals_rhs= fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. # The version message is extracted from the calling file's header # comments, with leading '# ' stripped: # 1. First display the progname and version # 2. Followed by the header comment line matching /^# Written by / # 3. Then a blank line followed by the first following line matching # /^# Copyright / # 4. Immediately followed by any lines between the previous matches, # except lines preceding the intervening completely blank line. # For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /^# Written by /!b s|^# ||; p; n :fwd2blnk /./ { n b fwd2blnk } p; n :holdwrnt s|^# || s|^# *$|| /^Copyright /!{ /./H n b holdwrnt } s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| G s|\(\n\)\n*|\1|g p; q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.5.4' # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd year=`date +%Y` cat < This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Originally written by Gordon Matzigkeit, 1996 (See AUTHORS for complete contributor listing) EOF exit $? } # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information --finish use operation '--mode=finish' --mode=MODE use operation mode MODE --no-finish don't update shared library cache --no-quiet, --no-silent print default informational messages --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --reorder-cache=DIRS reorder shared library cache for preferred DIRS --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname $scriptversion Debian-2.5.4-9 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_reorder_cache=false opt_preserve_dup_deps=false opt_quiet=false opt_finishing=true opt_warning= nonopt= preserve_args= _G_rc_lt_options_prep=: _G_rc_lt_options_prep=: # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; *) _G_rc_lt_options_prep=false ;; esac if $_G_rc_lt_options_prep; then # Pass back the list of options. func_quote eval ${1+"$@"} libtool_options_prep_result=$func_quote_result fi } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd _G_rc_lt_parse_options=false # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument '$1' for $_G_opt" exit_cmd=exit ;; esac shift ;; --no-finish) opt_finishing=false func_append preserve_args " $_G_opt" ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --reorder-cache) opt_reorder_cache=true shared_lib_dirs=$1 if test -n "$shared_lib_dirs"; then case $1 in # Must begin with /: /*) ;; # Catch anything else as an error (relative paths) *) func_error "invalid argument '$1' for $_G_opt" func_error "absolute paths are required for $_G_opt" exit_cmd=exit ;; esac fi shift ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"} ; shift _G_match_lt_parse_options=false break ;; esac $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done if $_G_rc_lt_parse_options; then # save modified positional parameters for caller func_quote eval ${1+"$@"} libtool_parse_options_result=$func_quote_result fi } func_add_hook func_parse_options libtool_parse_options # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { if $opt_warning; then $debug_cmd $warning_func ${1+"$@"} fi } # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host_os in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 cygwin* | mingw* | windows* | pw32* | cegcc* | solaris2* | os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote eval ${1+"$@"} libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, windows, cygwin, or some other w32 environment. Relies on a # correctly configured wine environment available, with the winepath program # in $build's $PATH. Assumes ARG has no leading or trailing path separator # characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep # func_convert_delimited_path PATH ORIG_DELIMITER NEW_DELIMITER # Replaces a delimiter for a given path. func_convert_delimited_path () { converted_path=`$ECHO "$1" | $SED "s#$2#$3#g"` } # end func_convert_delimited_path ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_reorder_shared_lib_cache DIRS # Reorder the shared library cache by unconfiguring previous shared library cache # and configuring preferred search directories before previous search directories. # Previous shared library cache: /usr/lib /usr/local/lib # Preferred search directories: /tmp/testing # Reordered shared library cache: /tmp/testing /usr/lib /usr/local/lib func_reorder_shared_lib_cache () { $debug_cmd case $host_os in openbsd*) get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"` func_convert_delimited_path "$get_search_directories" ':' '\ ' save_search_directories=$converted_path func_convert_delimited_path "$1" ':' '\ ' # Ensure directories exist for dir in $converted_path; do # Ensure each directory is an absolute path case $dir in /*) ;; *) func_error "Directory '$dir' is not an absolute path" exit $EXIT_FAILURE ;; esac # Ensure no trailing slashes func_stripname '' '/' "$dir" dir=$func_stripname_result if test -d "$dir"; then if test -n "$preferred_search_directories"; then preferred_search_directories="$preferred_search_directories $dir" else preferred_search_directories=$dir fi else func_error "Directory '$dir' does not exist" exit $EXIT_FAILURE fi done PATH="$PATH:/sbin" ldconfig -U $save_search_directories PATH="$PATH:/sbin" ldconfig -m $preferred_search_directories $save_search_directories get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"` func_convert_delimited_path "$get_search_directories" ':' '\ ' reordered_search_directories=$converted_path $ECHO "Original: $save_search_directories" $ECHO "Reordered: $reordered_search_directories" exit $EXIT_SUCCESS ;; *) func_error "--reorder-cache is not supported for host_os=$host_os." exit $EXIT_FAILURE ;; esac } # end func_reorder_shared_lib_cache # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_arg pretty "$libobj" test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | windows* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_arg pretty "$srcfile" qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG -Xcompiler FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wa,FLAG -Xassembler FLAG pass linker-specific FLAG directly to the assembler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # If option '--reorder-cache', reorder the shared library cache and exit. if $opt_reorder_cache; then func_reorder_shared_lib_cache $shared_lib_dirs fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs" && $opt_finishing; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done if test "false" = "$opt_finishing"; then echo echo "NOTE: finish_cmds were not executed during testing, so you must" echo "manually run ldconfig to add a given test directory, LIBDIR, to" echo "the search path for generated executables." fi echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_arg pretty "$nonopt" install_prog="$func_quote_arg_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_arg pretty "$arg" func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_arg pretty "$arg" func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then func_quote_arg pretty "$arg2" fi func_append install_shared_prog " $func_quote_arg_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_arg pretty "$install_override_mode" func_append install_shared_prog " -m $func_quote_arg_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Strip any trailing slash from the destination. func_stripname '' '/' "$libdir" destlibdir=$func_stripname_result func_stripname '' '/' "$destdir" s_destdir=$func_stripname_result # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw* | *windows*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_arg expand,pretty "$relink_command" eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *windows* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *windows* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *windows* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 case $host in i[3456]86-*-mingw32*) eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" ;; *) eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/__nm_//' >> '$nlist'" ;; esac } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *windows* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw/windows # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw/windows-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" func_quote_arg pretty "$ECHO" qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw* | *-*-windows* | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw/windows when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #if defined _WIN32 && !defined __GNUC__ # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ _CRTIMP int __cdecl _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw* | windows*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= compile_rpath_tail= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= temp_rpath_tail= thread_safe=no vinfo= vinfo_number=no weak_libs= rpath_arg= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_arg pretty,unquoted "$arg" qarg=$func_quote_arg_unquoted_result func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "argument to -rpath is not absolute: $arg" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xassembler) func_append compiler_flags " -Xassembler $qarg" prev= func_append compile_command " -Xassembler $qarg" func_append finalize_command " -Xassembler $qarg" continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. # -q