*** COPYRIGHT *** 1c1 < Copyright 1992 by Jutta Degener and Carsten Bormann, --- > Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann, 14c14 < Berlin, 15.09.1992 --- > Berlin, 28.11.1994 *** ChangeLog *** 0a1,11 > Mon Nov 28 20:49:57 1994 Jutta Degener (jutta@cs.tu-berlin.de) > > * Release 1.0 Patchlevel 5 > src/toast_audio.c: initialization should return -1 on error > src/gsm_destroy.c: #include configuration header file > src/add.c: gsm_sub should cast its parameters to longword > man/*: bug reports to {jutta,cabo}@cs.tu-berlin.de, not to toast@tub > inc/private.h: longword long by default, not int > inc/toast.h: read/write fopen modes "rb" and "wb", not just "r" > src/toast.c: better (or different, anyway) error handling in process() > *** INSTALL *** 3,5c3,5 < * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische < * Universitaet Berlin. See the accompanying file "COPYRIGHT" for < * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. --- > * Copyright 1992, 1993, 1994, by Jutta Degener and Carsten Bormann, > * Technische Universitaet Berlin. See the accompanying file "COPYRIGHT" > * for details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. 85c85,86 < Please direct bug reports to toast@tub.cs.tu-berlin.de. --- > Please direct bug reports to jutta@cs.tu-berlin.de and > cabo@cs.tu-berlin.de . *** inc/gsm.h *** 7c7 < /*$Header: /home/kbs/jutta/src/gsm/gsm-1.0/inc/RCS/gsm.h,v 1.6 1994/05/10 20:18:20 jutta Exp $*/ --- > /*$Header: /home/kbs/jutta/src/gsm/gsm-1.0/inc/RCS/gsm.h,v 1.7 1994/11/28 20:39:48 jutta Exp $*/ 47c47 < #define GSM_PATCHLEVEL 4 --- > #define GSM_PATCHLEVEL 5 *** inc/private.h *** 7c7 < /*$Header: /home/kbs/jutta/src/gsm/gsm-1.0/inc/RCS/private.h,v 1.3 1994/05/10 20:18:23 jutta Exp $*/ --- > /*$Header: /home/kbs/jutta/src/gsm/gsm-1.0/inc/RCS/private.h,v 1.4 1994/11/28 20:25:03 jutta Exp $*/ 13c13 < typedef int longword; /* 32 bit signed int */ --- > typedef long longword; /* 32 bit signed int */ 16c16 < typedef unsigned int ulongword; /* unsigned longword */ --- > typedef unsigned long ulongword; /* unsigned longword */ *** inc/toast.h *** 7c7 < /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/inc/RCS/toast.h,v 1.2 1994/05/10 20:18:25 jutta Exp $ */ --- > /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/inc/RCS/toast.h,v 1.3 1994/11/28 20:25:03 jutta Exp $ */ 47,48c47,48 < # define READ "r" < # define WRITE "w" --- > # define READ "rb" > # define WRITE "wb" *** man/bitter.1 *** 70c70 < Please direct bug reports to toast@tub.cs.tu-berlin.de. --- > Please direct bug reports to jutta@cs.tu-berlin.de and cabo@cs.tu-berlin.de. *** man/gsm.3 *** 22c22 < gsm_frame dst; --- > gsm_frame dst; 69c69 < .SH EXAMPLES --- > .SH EXAMPLE 75a76 > int cc, soundfd; 77,81c78,85 < play() { < if (!(handle = gsm_create())) exit(1); < while (read(1, (char *)buf, sizeof(buf)) == sizeof(buf)) { < if (gsm_decode(handle, buf, sample) < 0) exit(2); < write(soundfd, sample, sizeof(sample)); --- > play() { /* read compressed data from standard input, write to soundfd */ > > if (!(handle = gsm_create())) error... > while (cc = read(0, (char *)buf, sizeof buf)) { > if (cc != sizeof buf) error... > if (gsm_decode(handle, buf, sample) < 0) error... > if (write(soundfd, sample, sizeof sample) != sizeof sample) > error... 86,88c90,94 < record() { < if (!(handle = gsm_create())) exit(1); < while (read(1, sample, sizeof(sample)) == sizeof(sample)) { --- > record() { /* read from soundfd, write compressed to standard output */ > > if (!(handle = gsm_create())) error... > while (cc = read(soundfd, sample, sizeof sample)) { > if (cc != sizeof sample) error... 90c96,97 < write(s, (char *)buf, sizeof(buf)); --- > if (write(1, (char *)buf, sizeof buf) != sizeof sample) > error... 96c103 < Please direct bug reports to toast@tub.cs.tu-berlin.de. --- > Please direct bug reports to jutta@cs.tu-berlin.de and cabo@cs.tu-berlin.de. *** man/gsm_explode.3 *** 45c45 < Please direct bug reports to toast@tub.cs.tu-berlin.de. --- > Please direct bug reports to jutta@cs.tu-berlin.de and cabo@cs.tu-berlin.de. *** man/gsm_option.3 *** 77c77 < Please direct bug reports to toast@tub.cs.tu-berlin.de. --- > Please direct bug reports to jutta@cs.tu-berlin.de and cabo@cs.tu-berlin.de. *** man/gsm_print.3 *** 50c50 < Please direct bug reports to toast@tub.cs.tu-berlin.de. --- > Please direct bug reports to jutta@cs.tu-berlin.de and cabo@cs.tu-berlin.de. *** man/toast.1 *** 138c138 < Please direct bug reports to toast@tub.cs.tu-berlin.de. --- > Please direct bug reports to jutta@cs.tu-berlin.de and cabo@cs.tu-berlin.de. *** src/add.c *** 7c7 < /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/add.c,v 1.3 1994/05/10 20:18:30 jutta Exp $ */ --- > /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/add.c,v 1.4 1994/11/28 19:52:16 jutta Exp $ */ 25c25 < longword sum = a + b; --- > longword sum = (longword)a + (longword)b; 31c31 < longword diff = a - b; --- > longword diff = (longword)a - (longword)b; *** src/gsm_destroy.c *** 7c7 < /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/gsm_destroy.c,v 1.2 1994/05/10 20:18:34 jutta Exp $ */ --- > /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/gsm_destroy.c,v 1.3 1994/11/28 19:52:25 jutta Exp $ */ 9a10 > #include "config.h" *** src/lpc.c *** 7c7 < /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/lpc.c,v 1.2 1994/05/10 20:18:43 jutta Exp $ */ --- > /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/lpc.c,v 1.3 1994/11/28 19:52:31 jutta Exp $ */ 189c189 < if (L_ACF[0] == 0) { /* everything is the same. */ --- > if (L_ACF[0] == 0) { *** src/toast.c *** 7c7 < /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/toast.c,v 1.4 1994/05/10 20:18:49 jutta Exp $ */ --- > /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/toast.c,v 1.5 1994/11/29 00:55:54 jutta Exp $ */ 418,424d417 < < if (!f_decode && !f_cat && name && suffix( name, SUFFIX_TOASTED )) { < fprintf(stderr, < "%s: %s already has \"%s\" suffix -- unchanged.\n", < progname, name, SUFFIX_TOASTED ); < return 0; < } 469,471c462,471 < if (!f_decode) inname = strcpy(emalloc(strlen(name)+1), name); < else inname = codename(name); < --- > if (f_decode) inname = codename(name); > else { > if (!f_cat && suffix(name, SUFFIX_TOASTED)) { > fprintf(stderr, > "%s: %s already has \"%s\" suffix -- unchanged.\n", > progname, name, SUFFIX_TOASTED ); > return 0; > } > inname = strcpy(emalloc(strlen(name)+1), name); > } 525c525,528 < if (!(r = gsm_create())) return -1; --- > if (!(r = gsm_create())) { > perror(progname); > return -1; > } 542c545 < perror(inname ? inname : ""); --- > perror(inname ? inname : "stdin"); 544c547 < progname, inname ? inname : ""); --- > progname, inname ? inname : "stdin"); 561c564,567 < if (!(r = gsm_create())) return -1; --- > if (!(r = gsm_create())) { /* malloc failed */ > perror(progname); > return -1; > } 572c578 < inname ? inname : "" ); --- > inname ? inname : "stdin" ); 573a580 > errno = 0; 576d582 < 579c585 < progname, outname ? outname : "stdout"); --- > progname, inname ? inname : "stdin"); 580a587 > errno = 0; 594c601 < perror(inname ? inname : "" ); --- > perror(inname ? inname : "stdin" ); 596c603 < inname ? inname : ""); --- > inname ? inname : "stdin"); 606a614,615 > int step = 0; > 613,642c622,623 < if ( !open_input( name, &instat ) < || !open_output( name ) < || (*(f_decode ? init_output : init_input))() < || (*(f_decode ? process_decode : process_encode))() < || fflush(out) < 0 < || ferror(out)) { < < err: if (out) { < perror(outname ? outname : "stdout"); < fprintf(stderr, "%s: error writing \"%s\"\n", < progname, outname ? outname : "stdout"); < < if (out != stdout) { < (void)fclose(out); < if ( unlink(outname) < 0 < && errno != ENOENT < && errno != EINTR) { < < perror(outname); < fprintf(stderr, < "%s: could not unlink \"%s\"\n", < progname, outname); < } < } < } < < if (in && in != stdin) fclose(in); < < if (inname && inname != name) free(inname); < if (outname && outname != name) free(outname); --- > if (!open_input(name, &instat) || !open_output(name)) > goto err; 644c625,641 < return -1; --- > if ((*(f_decode ? init_output : init_input))()) { > fprintf(stderr, "%s: error %s %s\n", > progname, > f_decode ? "writing header to" : "reading header from", > f_decode ? (outname ? outname : "stdout") > : (inname ? inname : "stdin")); > goto err; > } > > if ((*(f_decode ? process_decode : process_encode))()) > goto err; > > if (fflush(out) < 0 || ferror(out)) { > perror(outname ? outname : "stdout"); > fprintf(stderr, "%s: error writing \"%s\"\n", progname, > outname ? outname:"stdout"); > goto err; 653,654c650,656 < if (fclose(out) < 0) goto err; < free(outname); --- > if (fclose(out) < 0) { > perror(outname); > fprintf(stderr, "%s: error writing \"%s\"\n", > progname, outname); > goto err; > } > if (outname != name) free(outname); 657c659 < --- > out = (FILE *)0; 659c661 < fclose(in); --- > (void)fclose(in), in = (FILE *)0; 666a669 > goto err; 668c671 < free(inname); --- > if (inname != name) free(inname); 671a675,695 > > /* > * Error handling and cleanup: > * - error out: close out, unlink it, close in, free the names. > * - > */ > err: > if (out && out != stdout) { > (void)fclose(out), out = (FILE *)0; > if (unlink(outname) < 0 && errno != ENOENT && errno != EINTR) { > perror(outname); > fprintf(stderr, "%s: could not unlink \"%s\"\n", > progname, outname); > } > } > if (in && in != stdin) (void)fclose(in), in = (FILE *)0; > > if (inname && inname != name) free(inname); > if (outname && outname != name) free(outname); > > return -1; 678c702 < "$Id: toast.c,v 1.4 1994/05/10 20:18:49 jutta Exp $" ); --- > "$Id: toast.c,v 1.5 1994/11/29 00:55:54 jutta Exp $" ); *** src/toast_audio.c *** 7c7 < /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/toast_audio.c,v 1.3 1994/05/10 20:18:52 jutta Exp $ */ --- > /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/toast_audio.c,v 1.5 1994/11/29 00:55:54 jutta Exp $ */ 68c68,74 < || fseek(in, (long)(len - 4*4), 1) < 0) return 0; --- > || fseek(in, (long)(len - 4*4), 1) < 0) { > fprintf(stderr, > "%s: bad (missing?) header in Sun audio file \"%s\";\n\ > Try one of -u, -a, -l instead (%s -h for help).\n", > progname, inname ? inname : "stdin", progname); > return -1; > } 76c82 < "%s: warning: file format #%lu for %s not implemented.\n", --- > "%s: warning: file format #%lu for %s not implemented, defaulting to u-law.\n", .