Bug#107845: Bug in package gcc-3 on hppa (compiler flag)
On Sat, Aug 11, 2001 at 09:53:46AM +0200, Matthias Klose wrote:
> tags 107845 + moreinfo
> thanks
>
> Please send the preprocessed file, which fails to compile with this
> flag.
Sorry for this. It is actually the wrong machine, it's merulo the ia64
machine instead of hppa.
The error is valid though and the preprocessed file is attached.
B.
--
B. Warmerdam GNU/Debian Linux
bartw@xs4all.nl, bartw@debian.org (Keyid: 10A0FDD1) ----------------
# 94 "wav2cdr.c"
# 1 "/usr/lib/gcc-lib/ia64-linux/2.96/include/stddef.h" 1 3
# 147 "/usr/lib/gcc-lib/ia64-linux/2.96/include/stddef.h" 3
typedef long int ptrdiff_t;
# 199 "/usr/lib/gcc-lib/ia64-linux/2.96/include/stddef.h" 3
typedef long unsigned int size_t;
# 287 "/usr/lib/gcc-lib/ia64-linux/2.96/include/stddef.h" 3
typedef int wchar_t;
# 95 "wav2cdr.c" 2
# 1 "/usr/include/stdlib.h" 1 3
# 25 "/usr/include/stdlib.h" 3
# 1 "/usr/include/features.h" 1 3
# 283 "/usr/include/features.h" 3
# 1 "/usr/include/sys/cdefs.h" 1 3
# 284 "/usr/include/features.h" 2 3
# 312 "/usr/include/features.h" 3
# 1 "/usr/include/gnu/stubs.h" 1 3
# 313 "/usr/include/features.h" 2 3
# 26 "/usr/include/stdlib.h" 2 3
# 1 "/usr/lib/gcc-lib/ia64-linux/2.96/include/stddef.h" 1 3
# 34 "/usr/include/stdlib.h" 2 3
# 94 "/usr/include/stdlib.h" 3
typedef struct
{
int quot;
int rem;
} div_t;
typedef struct
{
long int quot;
long int rem;
} ldiv_t;
# 133 "/usr/include/stdlib.h" 3
extern size_t __ctype_get_mb_cur_max (void) ;
extern double atof (__const char *__nptr) __attribute__ ((__pure__));
extern int atoi (__const char *__nptr) __attribute__ ((__pure__));
extern long int atol (__const char *__nptr) __attribute__ ((__pure__));
# 150 "/usr/include/stdlib.h" 3
extern double strtod (__const char *__restrict __nptr,
char **__restrict __endptr) ;
# 163 "/usr/include/stdlib.h" 3
extern long int strtol (__const char *__restrict __nptr,
char **__restrict __endptr, int __base) ;
extern unsigned long int strtoul (__const char *__restrict __nptr,
char **__restrict __endptr, int __base)
;
# 250 "/usr/include/stdlib.h" 3
extern double __strtod_internal (__const char *__restrict __nptr,
char **__restrict __endptr, int __group)
;
extern float __strtof_internal (__const char *__restrict __nptr,
char **__restrict __endptr, int __group)
;
extern long double __strtold_internal (__const char *__restrict __nptr,
char **__restrict __endptr,
int __group) ;
extern long int __strtol_internal (__const char *__restrict __nptr,
char **__restrict __endptr,
int __base, int __group) ;
extern unsigned long int __strtoul_internal (__const char *__restrict __nptr,
char **__restrict __endptr,
int __base, int __group) ;
__extension__
extern long long int __strtoll_internal (__const char *__restrict __nptr,
char **__restrict __endptr,
int __base, int __group) ;
__extension__
extern unsigned long long int __strtoull_internal (__const char *
__restrict __nptr,
char **__restrict __endptr,
int __base, int __group)
;
extern __inline double
strtod (__const char *__restrict __nptr, char **__restrict __endptr)
{
return __strtod_internal (__nptr, __endptr, 0);
}
extern __inline long int
strtol (__const char *__restrict __nptr, char **__restrict __endptr,
int __base)
{
return __strtol_internal (__nptr, __endptr, __base, 0);
}
extern __inline unsigned long int
strtoul (__const char *__restrict __nptr, char **__restrict __endptr,
int __base)
{
return __strtoul_internal (__nptr, __endptr, __base, 0);
}
# 354 "/usr/include/stdlib.h" 3
extern __inline double
atof (__const char *__nptr)
{
return strtod (__nptr, (char **) ((void *)0));
}
extern __inline int
atoi (__const char *__nptr)
{
return (int) strtol (__nptr, (char **) ((void *)0), 10);
}
extern __inline long int
atol (__const char *__nptr)
{
return strtol (__nptr, (char **) ((void *)0), 10);
}
# 446 "/usr/include/stdlib.h" 3
extern int rand (void) ;
extern void srand (unsigned int __seed) ;
# 527 "/usr/include/stdlib.h" 3
extern void *malloc (size_t __size) __attribute__ ((__malloc__));
extern void *calloc (size_t __nmemb, size_t __size)
__attribute__ ((__malloc__));
extern void *realloc (void *__ptr, size_t __size) __attribute__ ((__malloc__));
extern void free (void *__ptr) ;
# 561 "/usr/include/stdlib.h" 3
extern void abort (void) __attribute__ ((__noreturn__));
extern int atexit (void (*__func) (void)) ;
# 577 "/usr/include/stdlib.h" 3
extern void exit (int __status) __attribute__ ((__noreturn__));
# 587 "/usr/include/stdlib.h" 3
extern char *getenv (__const char *__name) ;
extern char *__secure_getenv (__const char *__name) ;
# 655 "/usr/include/stdlib.h" 3
extern int system (__const char *__command) ;
# 680 "/usr/include/stdlib.h" 3
typedef int (*__compar_fn_t) (__const void *, __const void *);
# 689 "/usr/include/stdlib.h" 3
extern void *bsearch (__const void *__key, __const void *__base,
size_t __nmemb, size_t __size, __compar_fn_t __compar);
extern void qsort (void *__base, size_t __nmemb, size_t __size,
__compar_fn_t __compar);
extern int abs (int __x) __attribute__ ((__const__));
extern long int labs (long int __x) __attribute__ ((__const__));
# 710 "/usr/include/stdlib.h" 3
extern div_t div (int __numer, int __denom)
__attribute__ ((__const__));
extern ldiv_t ldiv (long int __numer, long int __denom)
__attribute__ ((__const__));
# 773 "/usr/include/stdlib.h" 3
extern int mblen (__const char *__s, size_t __n) ;
extern int mbtowc (wchar_t *__restrict __pwc,
__const char *__restrict __s, size_t __n) ;
extern int wctomb (char *__s, wchar_t __wchar) ;
extern size_t mbstowcs (wchar_t *__restrict __pwcs,
__const char *__restrict __s, size_t __n) ;
extern size_t wcstombs (char *__restrict __s,
__const wchar_t *__restrict __pwcs, size_t __n)
;
# 96 "wav2cdr.c" 2
# 1 "/usr/include/stdio.h" 1 3
# 28 "/usr/include/stdio.h" 3
# 1 "/usr/include/features.h" 1 3
# 29 "/usr/include/stdio.h" 2 3
# 1 "/usr/lib/gcc-lib/ia64-linux/2.96/include/stddef.h" 1 3
# 35 "/usr/include/stdio.h" 2 3
# 1 "/usr/include/bits/types.h" 1 3
# 26 "/usr/include/bits/types.h" 3
# 1 "/usr/include/features.h" 1 3
# 27 "/usr/include/bits/types.h" 2 3
# 1 "/usr/lib/gcc-lib/ia64-linux/2.96/include/stddef.h" 1 3
# 30 "/usr/include/bits/types.h" 2 3
typedef unsigned char __u_char;
typedef unsigned short int __u_short;
typedef unsigned int __u_int;
typedef unsigned long int __u_long;
typedef unsigned long int __u_quad_t;
typedef long int __quad_t;
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef signed short int __int16_t;
typedef unsigned short int __uint16_t;
typedef signed int __int32_t;
typedef unsigned int __uint32_t;
typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;
typedef __quad_t *__qaddr_t;
typedef __uint64_t __dev_t;
typedef __uint32_t __uid_t;
typedef __uint32_t __gid_t;
typedef __uint64_t __ino_t;
typedef __uint64_t __ino64_t;
typedef __uint32_t __mode_t;
typedef __uint64_t __nlink_t;
typedef __int64_t __off_t;
typedef __int64_t __off64_t;
typedef __int64_t __loff_t;
typedef __int32_t __pid_t;
typedef __int64_t __ssize_t;
typedef __uint64_t __rlim_t;
typedef __uint64_t __rlim64_t;
typedef __int64_t __blkcnt_t;
typedef __int64_t __blkcnt64_t;
typedef __uint64_t __fsblkcnt_t;
typedef __uint64_t __fsblkcnt64_t;
typedef __uint64_t __fsfilcnt_t;
typedef __uint64_t __fsfilcnt64_t;
typedef __uint32_t __id_t;
typedef struct
{
int __val[2];
} __fsid_t;
typedef int __daddr_t;
typedef char *__caddr_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __swblk_t;
typedef long int __clock_t;
typedef int __key_t;
typedef int __clockid_t;
typedef int __timer_t;
typedef int __ipc_pid_t;
typedef long int __blksize_t;
typedef int __t_scalar_t;
typedef unsigned int __t_uscalar_t;
typedef long int __intptr_t;
typedef unsigned int __socklen_t;
# 37 "/usr/include/stdio.h" 2 3
# 45 "/usr/include/stdio.h" 3
typedef struct _IO_FILE FILE;
# 55 "/usr/include/stdio.h" 3
typedef struct _IO_FILE __FILE;
# 65 "/usr/include/stdio.h" 3
# 1 "/usr/include/libio.h" 1 3
# 32 "/usr/include/libio.h" 3
# 1 "/usr/include/_G_config.h" 1 3
# 9 "/usr/include/_G_config.h" 3
# 1 "/usr/include/bits/types.h" 1 3
# 10 "/usr/include/_G_config.h" 2 3
# 1 "/usr/lib/gcc-lib/ia64-linux/2.96/include/stddef.h" 1 3
# 312 "/usr/lib/gcc-lib/ia64-linux/2.96/include/stddef.h" 3
typedef unsigned int wint_t;
# 15 "/usr/include/_G_config.h" 2 3
# 24 "/usr/include/_G_config.h" 3
# 1 "/usr/include/wchar.h" 1 3
# 48 "/usr/include/wchar.h" 3
# 1 "/usr/lib/gcc-lib/ia64-linux/2.96/include/stddef.h" 1 3
# 49 "/usr/include/wchar.h" 2 3
# 1 "/usr/include/bits/wchar.h" 1 3
# 51 "/usr/include/wchar.h" 2 3
# 67 "/usr/include/wchar.h" 3
typedef struct
{
int __count;
union
{
wint_t __wch;
char __wchb[4];
} __value;
} __mbstate_t;
# 25 "/usr/include/_G_config.h" 2 3
typedef struct
{
__off_t __pos;
__mbstate_t __state;
} _G_fpos_t;
typedef struct
{
__off64_t __pos;
__mbstate_t __state;
} _G_fpos64_t;
# 44 "/usr/include/_G_config.h" 3
# 1 "/usr/include/gconv.h" 1 3
# 26 "/usr/include/gconv.h" 3
# 1 "/usr/include/features.h" 1 3
# 27 "/usr/include/gconv.h" 2 3
# 1 "/usr/include/wchar.h" 1 3
# 48 "/usr/include/wchar.h" 3
# 1 "/usr/lib/gcc-lib/ia64-linux/2.96/include/stddef.h" 1 3
# 49 "/usr/include/wchar.h" 2 3
# 1 "/usr/include/bits/wchar.h" 1 3
# 51 "/usr/include/wchar.h" 2 3
# 29 "/usr/include/gconv.h" 2 3
# 1 "/usr/lib/gcc-lib/ia64-linux/2.96/include/stddef.h" 1 3
# 31 "/usr/include/gconv.h" 2 3
enum
{
__GCONV_OK = 0,
__GCONV_NOCONV,
__GCONV_NODB,
__GCONV_NOMEM,
__GCONV_EMPTY_INPUT,
__GCONV_FULL_OUTPUT,
__GCONV_ILLEGAL_INPUT,
__GCONV_INCOMPLETE_INPUT,
__GCONV_ILLEGAL_DESCRIPTOR,
__GCONV_INTERNAL_ERROR
};
enum
{
__GCONV_IS_LAST = 0x0001,
__GCONV_IGNORE_ERRORS = 0x0002
};
struct __gconv_step;
struct __gconv_step_data;
struct __gconv_loaded_object;
struct __gconv_trans_data;
typedef int (*__gconv_fct) (struct __gconv_step *, struct __gconv_step_data *,
__const unsigned char **, __const unsigned char *,
unsigned char **, size_t *, int, int);
typedef int (*__gconv_init_fct) (struct __gconv_step *);
typedef void (*__gconv_end_fct) (struct __gconv_step *);
typedef int (*__gconv_trans_fct) (struct __gconv_step *,
struct __gconv_step_data *, void *,
__const unsigned char *,
__const unsigned char **,
__const unsigned char *, unsigned char **,
size_t *);
typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *,
__const unsigned char *,
unsigned char *, unsigned char *);
typedef int (*__gconv_trans_query_fct) (__const char *, __const char ***,
size_t *);
typedef int (*__gconv_trans_init_fct) (void **, const char *);
typedef void (*__gconv_trans_end_fct) (void *);
struct __gconv_trans_data
{
__gconv_trans_fct __trans_fct;
__gconv_trans_context_fct __trans_context_fct;
__gconv_trans_end_fct __trans_end_fct;
void *__data;
struct __gconv_trans_data *__next;
};
struct __gconv_step
{
struct __gconv_loaded_object *__shlib_handle;
__const char *__modname;
int __counter;
char *__from_name;
char *__to_name;
__gconv_fct __fct;
__gconv_init_fct __init_fct;
__gconv_end_fct __end_fct;
int __min_needed_from;
int __max_needed_from;
int __min_needed_to;
int __max_needed_to;
int __stateful;
void *__data;
};
struct __gconv_step_data
{
unsigned char *__outbuf;
unsigned char *__outbufend;
int __flags;
int __invocation_counter;
int __internal_use;
__mbstate_t *__statep;
__mbstate_t __state;
struct __gconv_trans_data *__trans;
};
typedef struct __gconv_info
{
size_t __nsteps;
struct __gconv_step *__steps;
__extension__ struct __gconv_step_data __data [0];
} *__gconv_t;
# 45 "/usr/include/_G_config.h" 2 3
typedef union
{
struct __gconv_info __cd;
struct
{
struct __gconv_info __cd;
struct __gconv_step_data __data;
} __combined;
} _G_iconv_t;
typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
# 33 "/usr/include/libio.h" 2 3
# 53 "/usr/include/libio.h" 3
# 1 "/usr/lib/gcc-lib/ia64-linux/2.96/include/stdarg.h" 1 3
# 43 "/usr/lib/gcc-lib/ia64-linux/2.96/include/stdarg.h" 3
typedef __builtin_va_list __gnuc_va_list;
# 54 "/usr/include/libio.h" 2 3
# 160 "/usr/include/libio.h" 3
struct _IO_jump_t; struct _IO_FILE;
# 170 "/usr/include/libio.h" 3
typedef void _IO_lock_t;
struct _IO_marker {
struct _IO_marker *_next;
struct _IO_FILE *_sbuf;
int _pos;
# 193 "/usr/include/libio.h" 3
};
enum __codecvt_result
{
__codecvt_ok,
__codecvt_partial,
__codecvt_error,
__codecvt_noconv
};
# 261 "/usr/include/libio.h" 3
struct _IO_FILE {
int _flags;
char* _IO_read_ptr;
char* _IO_read_end;
char* _IO_read_base;
char* _IO_write_base;
char* _IO_write_ptr;
char* _IO_write_end;
char* _IO_buf_base;
char* _IO_buf_end;
char *_IO_save_base;
char *_IO_backup_base;
char *_IO_save_end;
struct _IO_marker *_markers;
struct _IO_FILE *_chain;
int _fileno;
int _blksize;
__off_t _old_offset;
unsigned short _cur_column;
signed char _vtable_offset;
char _shortbuf[1];
_IO_lock_t *_lock;
# 305 "/usr/include/libio.h" 3
__off64_t _offset;
void *__pad1;
void *__pad2;
int _mode;
char _unused2[15 * sizeof (int) - 2 * sizeof (void *)];
};
typedef struct _IO_FILE _IO_FILE;
struct _IO_FILE_plus;
extern struct _IO_FILE_plus _IO_2_1_stdin_;
extern struct _IO_FILE_plus _IO_2_1_stdout_;
extern struct _IO_FILE_plus _IO_2_1_stderr_;
# 344 "/usr/include/libio.h" 3
typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
size_t __n);
typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
typedef int __io_close_fn (void *__cookie);
# 396 "/usr/include/libio.h" 3
extern int __underflow (_IO_FILE *) ;
extern int __uflow (_IO_FILE *) ;
extern int __overflow (_IO_FILE *, int) ;
extern wint_t __wunderflow (_IO_FILE *) ;
extern wint_t __wuflow (_IO_FILE *) ;
extern wint_t __woverflow (_IO_FILE *, wint_t) ;
# 426 "/usr/include/libio.h" 3
extern int _IO_getc (_IO_FILE *__fp) ;
extern int _IO_putc (int __c, _IO_FILE *__fp) ;
extern int _IO_feof (_IO_FILE *__fp) ;
extern int _IO_ferror (_IO_FILE *__fp) ;
extern int _IO_peekc_locked (_IO_FILE *__fp) ;
extern void _IO_flockfile (_IO_FILE *) ;
extern void _IO_funlockfile (_IO_FILE *) ;
extern int _IO_ftrylockfile (_IO_FILE *) ;
# 456 "/usr/include/libio.h" 3
extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
__gnuc_va_list, int *__restrict) ;
extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
__gnuc_va_list) ;
extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t) ;
extern size_t _IO_sgetn (_IO_FILE *, void *, size_t) ;
extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int) ;
extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int) ;
extern void _IO_free_backup_area (_IO_FILE *) ;
# 66 "/usr/include/stdio.h" 2 3
# 80 "/usr/include/stdio.h" 3
typedef _G_fpos_t fpos_t;
# 129 "/usr/include/stdio.h" 3
# 1 "/usr/include/bits/stdio_lim.h" 1 3
# 130 "/usr/include/stdio.h" 2 3
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;
extern int remove (__const char *__filename) ;
extern int rename (__const char *__old, __const char *__new) ;
extern FILE *tmpfile (void) ;
# 161 "/usr/include/stdio.h" 3
extern char *tmpnam (char *__s) ;
# 184 "/usr/include/stdio.h" 3
extern int fclose (FILE *__stream) ;
extern int fflush (FILE *__stream) ;
# 201 "/usr/include/stdio.h" 3
extern FILE *fopen (__const char *__restrict __filename,
__const char *__restrict __modes) ;
extern FILE *freopen (__const char *__restrict __filename,
__const char *__restrict __modes,
FILE *__restrict __stream) ;
# 254 "/usr/include/stdio.h" 3
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) ;
extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
int __modes, size_t __n) ;
# 273 "/usr/include/stdio.h" 3
extern int fprintf (FILE *__restrict __stream,
__const char *__restrict __format, ...) ;
extern int printf (__const char *__restrict __format, ...) ;
extern int sprintf (char *__restrict __s,
__const char *__restrict __format, ...) ;
extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
__gnuc_va_list __arg) ;
extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg)
;
extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
__gnuc_va_list __arg) ;
# 325 "/usr/include/stdio.h" 3
extern int fscanf (FILE *__restrict __stream,
__const char *__restrict __format, ...) ;
extern int scanf (__const char *__restrict __format, ...) ;
extern int sscanf (__const char *__restrict __s,
__const char *__restrict __format, ...) ;
# 351 "/usr/include/stdio.h" 3
extern int fgetc (FILE *__stream) ;
extern int getc (FILE *__stream) ;
extern int getchar (void) ;
# 374 "/usr/include/stdio.h" 3
extern int fputc (int __c, FILE *__stream) ;
extern int putc (int __c, FILE *__stream) ;
extern int putchar (int __c) ;
# 406 "/usr/include/stdio.h" 3
extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
;
# 417 "/usr/include/stdio.h" 3
extern char *gets (char *__s) ;
# 441 "/usr/include/stdio.h" 3
extern int fputs (__const char *__restrict __s, FILE *__restrict __stream)
;
# 451 "/usr/include/stdio.h" 3
extern int puts (__const char *__s) ;
extern int ungetc (int __c, FILE *__stream) ;
extern size_t fread (void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream) ;
extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __s) ;
# 475 "/usr/include/stdio.h" 3
extern int fseek (FILE *__stream, long int __off, int __whence) ;
extern long int ftell (FILE *__stream) ;
extern void rewind (FILE *__stream) ;
# 495 "/usr/include/stdio.h" 3
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos)
;
extern int fsetpos (FILE *__stream, __const fpos_t *__pos) ;
# 531 "/usr/include/stdio.h" 3
extern void clearerr (FILE *__stream) ;
extern int feof (FILE *__stream) ;
extern int ferror (FILE *__stream) ;
# 546 "/usr/include/stdio.h" 3
extern void perror (__const char *__s) ;
# 630 "/usr/include/stdio.h" 3
# 1 "/usr/include/bits/stdio.h" 1 3
# 40 "/usr/include/bits/stdio.h" 3
extern __inline int
vprintf (__const char *__restrict __fmt, __gnuc_va_list __arg)
{
return vfprintf (stdout, __fmt, __arg);
}
extern __inline int
getchar (void)
{
return _IO_getc (stdin);
}
# 72 "/usr/include/bits/stdio.h" 3
extern __inline int
putchar (int __c)
{
return _IO_putc (__c, stdout);
}
# 631 "/usr/include/stdio.h" 2 3
# 97 "wav2cdr.c" 2
# 1 "/usr/include/string.h" 1 3
# 26 "/usr/include/string.h" 3
# 1 "/usr/include/features.h" 1 3
# 27 "/usr/include/string.h" 2 3
# 1 "/usr/lib/gcc-lib/ia64-linux/2.96/include/stddef.h" 1 3
# 34 "/usr/include/string.h" 2 3
extern void *memcpy (void *__restrict __dest,
__const void *__restrict __src, size_t __n) ;
extern void *memmove (void *__dest, __const void *__src, size_t __n)
;
# 55 "/usr/include/string.h" 3
extern void *memset (void *__s, int __c, size_t __n) ;
extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
__attribute__ ((__pure__));
extern void *memchr (__const void *__s, int __c, size_t __n)
__attribute__ ((__pure__));
# 77 "/usr/include/string.h" 3
extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
;
extern char *strncpy (char *__restrict __dest,
__const char *__restrict __src, size_t __n) ;
extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
;
extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
size_t __n) ;
extern int strcmp (__const char *__s1, __const char *__s2)
__attribute__ ((__pure__));
extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
__attribute__ ((__pure__));
extern int strcoll (__const char *__s1, __const char *__s2)
__attribute__ ((__pure__));
extern size_t strxfrm (char *__restrict __dest,
__const char *__restrict __src, size_t __n) ;
# 155 "/usr/include/string.h" 3
extern char *strchr (__const char *__s, int __c) __attribute__ ((__pure__));
extern char *strrchr (__const char *__s, int __c) __attribute__ ((__pure__));
# 167 "/usr/include/string.h" 3
extern size_t strcspn (__const char *__s, __const char *__reject)
__attribute__ ((__pure__));
extern size_t strspn (__const char *__s, __const char *__accept)
__attribute__ ((__pure__));
extern char *strpbrk (__const char *__s, __const char *__accept)
__attribute__ ((__pure__));
extern char *strstr (__const char *__haystack, __const char *__needle)
__attribute__ ((__pure__));
# 187 "/usr/include/string.h" 3
extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
;
extern char *__strtok_r (char *__restrict __s,
__const char *__restrict __delim,
char **__restrict __save_ptr) ;
# 218 "/usr/include/string.h" 3
extern size_t strlen (__const char *__s) __attribute__ ((__pure__));
# 229 "/usr/include/string.h" 3
extern char *strerror (int __errnum) ;
# 238 "/usr/include/string.h" 3
extern void __bzero (void *__s, size_t __n) ;
# 357 "/usr/include/string.h" 3
# 1 "/usr/include/bits/string.h" 1 3
# 358 "/usr/include/string.h" 2 3
# 1 "/usr/include/bits/string2.h" 1 3
# 80 "/usr/include/bits/string2.h" 3
typedef struct { unsigned char __arr[2]; } __STRING2_COPY_ARR2 __attribute__ ((packed));
typedef struct { unsigned char __arr[3]; } __STRING2_COPY_ARR3 __attribute__ ((packed));
typedef struct { unsigned char __arr[4]; } __STRING2_COPY_ARR4 __attribute__ ((packed));
typedef struct { unsigned char __arr[5]; } __STRING2_COPY_ARR5 __attribute__ ((packed));
typedef struct { unsigned char __arr[6]; } __STRING2_COPY_ARR6 __attribute__ ((packed));
typedef struct { unsigned char __arr[7]; } __STRING2_COPY_ARR7 __attribute__ ((packed));
typedef struct { unsigned char __arr[8]; } __STRING2_COPY_ARR8 __attribute__ ((packed));
# 371 "/usr/include/bits/string2.h" 3
extern void *__rawmemchr (const void *__s, int __c);
# 477 "/usr/include/bits/string2.h" 3
extern __inline char *__strcpy_small (char *, __STRING2_COPY_ARR2,
__STRING2_COPY_ARR3,
__STRING2_COPY_ARR4,
__STRING2_COPY_ARR5,
__STRING2_COPY_ARR6,
__STRING2_COPY_ARR7,
__STRING2_COPY_ARR8, size_t);
extern __inline char *
__strcpy_small (char *__dest,
__STRING2_COPY_ARR2 __src2, __STRING2_COPY_ARR3 __src3,
__STRING2_COPY_ARR4 __src4, __STRING2_COPY_ARR5 __src5,
__STRING2_COPY_ARR6 __src6, __STRING2_COPY_ARR7 __src7,
__STRING2_COPY_ARR8 __src8, size_t __srclen)
{
union {
char __c;
__STRING2_COPY_ARR2 __sca2;
__STRING2_COPY_ARR3 __sca3;
__STRING2_COPY_ARR4 __sca4;
__STRING2_COPY_ARR5 __sca5;
__STRING2_COPY_ARR6 __sca6;
__STRING2_COPY_ARR7 __sca7;
__STRING2_COPY_ARR8 __sca8;
} *__u = (void *) __dest;
switch ((unsigned int) __srclen)
{
case 1:
__u->__c = '\0';
break;
case 2:
__extension__ __u->__sca2 = __src2;
break;
case 3:
__extension__ __u->__sca3 = __src3;
break;
case 4:
__extension__ __u->__sca4 = __src4;
break;
case 5:
__extension__ __u->__sca5 = __src5;
break;
case 6:
__extension__ __u->__sca6 = __src6;
break;
case 7:
__extension__ __u->__sca7 = __src7;
break;
case 8:
__extension__ __u->__sca8 = __src8;
break;
}
return __dest;
}
# 873 "/usr/include/bits/string2.h" 3
extern __inline size_t __strcspn_c1 (__const char *__s, char __reject);
extern __inline size_t
__strcspn_c1 (__const char *__s, char __reject)
{
register size_t __result = 0;
while (__s[__result] != '\0' && __s[__result] != __reject)
++__result;
return __result;
}
extern __inline size_t __strcspn_c2 (__const char *__s, char __reject1,
char __reject2);
extern __inline size_t
__strcspn_c2 (__const char *__s, char __reject1, char __reject2)
{
register size_t __result = 0;
while (__s[__result] != '\0' && __s[__result] != __reject1
&& __s[__result] != __reject2)
++__result;
return __result;
}
extern __inline size_t __strcspn_c3 (__const char *__s, char __reject1,
char __reject2, char __reject3);
extern __inline size_t
__strcspn_c3 (__const char *__s, char __reject1, char __reject2,
char __reject3)
{
register size_t __result = 0;
while (__s[__result] != '\0' && __s[__result] != __reject1
&& __s[__result] != __reject2 && __s[__result] != __reject3)
++__result;
return __result;
}
# 928 "/usr/include/bits/string2.h" 3
extern __inline size_t __strspn_c1 (__const char *__s, char __accept);
extern __inline size_t
__strspn_c1 (__const char *__s, char __accept)
{
register size_t __result = 0;
while (__s[__result] == __accept)
++__result;
return __result;
}
extern __inline size_t __strspn_c2 (__const char *__s, char __accept1,
char __accept2);
extern __inline size_t
__strspn_c2 (__const char *__s, char __accept1, char __accept2)
{
register size_t __result = 0;
while (__s[__result] == __accept1 || __s[__result] == __accept2)
++__result;
return __result;
}
extern __inline size_t __strspn_c3 (__const char *__s, char __accept1,
char __accept2, char __accept3);
extern __inline size_t
__strspn_c3 (__const char *__s, char __accept1, char __accept2, char __accept3)
{
register size_t __result = 0;
while (__s[__result] == __accept1 || __s[__result] == __accept2
|| __s[__result] == __accept3)
++__result;
return __result;
}
# 983 "/usr/include/bits/string2.h" 3
extern __inline char *__strpbrk_c2 (__const char *__s, int __accept1,
int __accept2);
extern __inline char *
__strpbrk_c2 (__const char *__s, int __accept1, int __accept2)
{
while (*__s != '\0' && *__s != __accept1 && *__s != __accept2)
++__s;
return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s;
}
extern __inline char *__strpbrk_c3 (__const char *__s, int __accept1,
int __accept2, int __accept3);
extern __inline char *
__strpbrk_c3 (__const char *__s, int __accept1, int __accept2,
int __accept3)
{
while (*__s != '\0' && *__s != __accept1 && *__s != __accept2
&& *__s != __accept3)
++__s;
return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s;
}
# 1045 "/usr/include/bits/string2.h" 3
extern __inline char *__strtok_r_1c (char *__s, char __sep, char **__nextp);
extern __inline char *
__strtok_r_1c (char *__s, char __sep, char **__nextp)
{
char *__result;
if (__s == ((void *)0))
__s = *__nextp;
while (*__s == __sep)
++__s;
if (*__s == '\0')
__result = ((void *)0);
else
{
__result = __s;
while (*__s != '\0' && *__s != __sep)
++__s;
if (*__s == '\0')
*__nextp = __s;
else
{
*__s = '\0';
*__nextp = __s + 1;
}
}
return __result;
}
# 1095 "/usr/include/bits/string2.h" 3
extern __inline char *__strsep_1c (char **__s, char __reject);
extern __inline char *
__strsep_1c (char **__s, char __reject)
{
register char *__retval = *__s;
if (__retval == ((void *)0))
return *__s = ((void *)0);
if (*__retval == __reject)
*(*__s)++ = '\0';
else
if ((*__s = (__extension__ (__builtin_constant_p (__reject) && (__reject) == '\0' ? (char *) __rawmemchr (__retval, __reject) : strchr (__retval, __reject)))) != ((void *)0))
*(*__s)++ = '\0';
else
*__s = ((void *)0);
return __retval;
}
extern __inline char *__strsep_2c (char **__s, char __reject1, char __reject2);
extern __inline char *
__strsep_2c (char **__s, char __reject1, char __reject2)
{
register char *__retval = *__s;
if (__retval == ((void *)0))
return *__s = ((void *)0);
if (*__retval == __reject1 || *__retval == __reject2)
*(*__s)++ = '\0';
else
{
register char *__cp = __retval;
while (*__cp != '\0' && *__cp != __reject1 && *__cp != __reject2)
++__cp;
if (*__cp != '\0')
{
*__s = __cp;
*(*__s)++ = '\0';
}
else
*__s = ((void *)0);
}
return __retval;
}
extern __inline char *__strsep_3c (char **__s, char __reject1, char __reject2,
char __reject3);
extern __inline char *
__strsep_3c (char **__s, char __reject1, char __reject2, char __reject3)
{
register char *__retval = *__s;
if (__retval == ((void *)0))
return *__s = ((void *)0);
if (*__retval == __reject1 || *__retval == __reject2
|| *__retval == __reject3)
*(*__s)++ = '\0';
else
{
register char *__cp = __retval;
while (*__cp != '\0' && *__cp != __reject1 && *__cp != __reject2
&& *__cp != __reject3)
++__cp;
if (*__cp != '\0')
{
*__s = __cp;
*(*__s)++ = '\0';
}
else
*__s = ((void *)0);
}
return __retval;
}
extern __inline char *__strsep_g (char **__s, __const char *__reject);
extern __inline char *
__strsep_g (char **__s, __const char *__reject)
{
register char *__retval = *__s;
if (__retval == ((void *)0))
return ((void *)0);
if ((*__s = __extension__ ({ char __a0, __a1, __a2; (__builtin_constant_p (__reject) && ((size_t)(const void *)((__reject) + 1) - (size_t)(const void *)(__reject) == 1) ? ((__a0 = ((__const char *) (__reject))[0], __a0 == '\0') ? ((void) (__retval), ((void *)0)) : ((__a1 = ((__const char *) (__reject))[1], __a1 == '\0') ? (__extension__ (__builtin_constant_p (__a0) && (__a0) == '\0' ? (char *) __rawmemchr (__retval, __a0) : strchr (__retval, __a0))) : ((__a2 = ((__const char *) (__reject))[2], __a2 == '\0') ? __strpbrk_c2 (__retval, __a0, __a1) : (((__const char *) (__reject))[3] == '\0' ? __strpbrk_c3 (__retval, __a0, __a1, __a2) : strpbrk (__retval, __reject))))) : strpbrk (__retval, __reject)); })) != ((void *)0))
*(*__s)++ = '\0';
return __retval;
}
# 361 "/usr/include/string.h" 2 3
# 98 "wav2cdr.c" 2
# 1 "/usr/include/errno.h" 1 3
# 29 "/usr/include/errno.h" 3
# 1 "/usr/include/features.h" 1 3
# 30 "/usr/include/errno.h" 2 3
# 1 "/usr/include/bits/errno.h" 1 3
# 25 "/usr/include/bits/errno.h" 3
# 1 "/usr/include/linux/errno.h" 1 3
# 1 "/usr/include/asm/errno.h" 1 3
# 5 "/usr/include/linux/errno.h" 2 3
# 26 "/usr/include/bits/errno.h" 2 3
# 36 "/usr/include/bits/errno.h" 3
extern int errno;
extern int *__errno_location (void) __attribute__ ((__const__));
# 37 "/usr/include/errno.h" 2 3
# 99 "wav2cdr.c" 2
# 1 "/usr/lib/gcc-lib/ia64-linux/2.96/include/limits.h" 1 3
# 11 "/usr/lib/gcc-lib/ia64-linux/2.96/include/limits.h" 3
# 1 "/usr/lib/gcc-lib/ia64-linux/2.96/include/syslimits.h" 1 3
# 1 "/usr/lib/gcc-lib/ia64-linux/2.96/include/limits.h" 1 3
# 130 "/usr/lib/gcc-lib/ia64-linux/2.96/include/limits.h" 3
# 1 "/usr/include/limits.h" 1 3
# 26 "/usr/include/limits.h" 3
# 1 "/usr/include/features.h" 1 3
# 27 "/usr/include/limits.h" 2 3
# 131 "/usr/lib/gcc-lib/ia64-linux/2.96/include/limits.h" 2 3
# 8 "/usr/lib/gcc-lib/ia64-linux/2.96/include/syslimits.h" 2 3
# 12 "/usr/lib/gcc-lib/ia64-linux/2.96/include/limits.h" 2 3
# 100 "wav2cdr.c" 2
# 1 "/usr/include/assert.h" 1 3
# 36 "/usr/include/assert.h" 3
# 1 "/usr/include/features.h" 1 3
# 37 "/usr/include/assert.h" 2 3
# 68 "/usr/include/assert.h" 3
extern void __assert_fail (__const char *__assertion, __const char *__file,
unsigned int __line, __const char *__function)
__attribute__ ((__noreturn__));
extern void __assert_perror_fail (int __errnum, __const char *__file,
unsigned int __line,
__const char *__function)
__attribute__ ((__noreturn__));
extern void __assert (const char *__assertion, const char *__file, int __line)
__attribute__ ((__noreturn__));
# 101 "wav2cdr.c" 2
# 1 "/usr/include/time.h" 1 3
# 28 "/usr/include/time.h" 3
# 1 "/usr/include/features.h" 1 3
# 29 "/usr/include/time.h" 2 3
# 38 "/usr/include/time.h" 3
# 1 "/usr/lib/gcc-lib/ia64-linux/2.96/include/stddef.h" 1 3
# 39 "/usr/include/time.h" 2 3
# 1 "/usr/include/bits/time.h" 1 3
# 43 "/usr/include/time.h" 2 3
# 56 "/usr/include/time.h" 3
# 1 "/usr/include/bits/types.h" 1 3
# 57 "/usr/include/time.h" 2 3
typedef __clock_t clock_t;
# 1 "/usr/include/bits/types.h" 1 3
# 68 "/usr/include/time.h" 2 3
typedef __time_t time_t;
# 118 "/usr/include/time.h" 3
struct tm
{
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
long int __tm_gmtoff;
__const char *__tm_zone;
};
# 163 "/usr/include/time.h" 3
extern clock_t clock (void) ;
extern time_t time (time_t *__timer) ;
extern double difftime (time_t __time1, time_t __time0)
__attribute__ ((__const__));
extern time_t mktime (struct tm *__tp) ;
extern size_t strftime (char *__restrict __s, size_t __maxsize,
__const char *__restrict __format,
__const struct tm *__restrict __tp) ;
# 194 "/usr/include/time.h" 3
extern struct tm *gmtime (__const time_t *__timer) ;
extern struct tm *localtime (__const time_t *__timer) ;
# 214 "/usr/include/time.h" 3
extern char *asctime (__const struct tm *__tp) ;
extern char *ctime (__const time_t *__timer) ;
# 234 "/usr/include/time.h" 3
extern char *__tzname[2];
extern int __daylight;
extern long int __timezone;
# 102 "wav2cdr.c" 2
# 1 "chelp.h" 1
# 140 "chelp.h"
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;
# 152 "chelp.h"
typedef unsigned char uchar;
typedef char string;
typedef unsigned char UINT8, byte;
typedef unsigned short UINT16, dbyte, word;
typedef unsigned int UINT32,
qbyte, dword, lword;
typedef signed char SINT8;
typedef signed short SINT16;
typedef signed int SINT32;
# 215 "chelp.h"
typedef enum {FALSE = 0, TRUE = !0} BOOL;
typedef enum {OFF, ON = ! OFF} OFFON;
typedef enum {PASS, FAIL = ! PASS} PASSFAIL;
# 104 "wav2cdr.c" 2
# 1 "wav2cdr.h" 1
# 34 "wav2cdr.h"
# 1 "/usr/lib/gcc-lib/ia64-linux/2.96/include/limits.h" 1 3
# 35 "wav2cdr.h" 2
# 1 "/usr/lib/gcc-lib/ia64-linux/2.96/include/stddef.h" 1 3
# 36 "wav2cdr.h" 2
# 1 "/usr/include/stdio.h" 1 3
# 37 "wav2cdr.h" 2
# 1 "chelp.h" 1
# 39 "wav2cdr.h" 2
# 66 "wav2cdr.h"
typedef struct {
char id[4];
UINT32 size;
} wav_chunkheader_t;
typedef struct {
wav_chunkheader_t RIFF;
char wavename[4];
wav_chunkheader_t Format;
UINT16 FormatTag;
UINT16 channels;
UINT32 SamplingRate;
UINT32 AvgBytesPerSec;
UINT16 BlockAlignment;
UINT16 BitsPerSample;
wav_chunkheader_t Data;
} wav_header_t;
# 171 "wav2cdr.h"
typedef union {
UINT8 i8 [2352];
SINT16 i16[2352/2];
UINT32 i32[2352/4];
} audiosect_t;
typedef enum {
ERR_OK = 0,
ERR_USAGE,
ERR_CMDARG,
ERR_IO,
ERR_NOMEM,
ERR_INTERNAL
} exit_t;
# 197 "wav2cdr.h"
typedef enum {
AF_default, AF_raw, AF_cdr, AF_wav, AF_err
} audioformat_t;
typedef struct {
BOOL little_input;
BOOL little_output;
signed long iscale;
float fscale;
BOOL swapwords;
BOOL monostereo;
BOOL silencecuts;
BOOL silenceinfo;
long silence_thresh;
long silence_delay;
unsigned long fadein;
unsigned long fadeout;
audioformat_t informat;
audioformat_t outformat;
unsigned long startsilence;
unsigned long endsilence;
string *infilename;
string *outfilename;
int numcuts;
string **cutstarts;
BOOL version;
BOOL usage;
BOOL help;
BOOL quiet;
BOOL verbose;
} cmdarg_t;
# 264 "wav2cdr.h"
typedef enum {
MS_NONE, MS_TOMONO, MS_TOSTEREO, MS_TOMONOSTEREO
} monostereo_t;
typedef unsigned long cdseccount_t;
typedef struct {
size_t n_in;
size_t n_returned;
BOOL first;
BOOL last;
BOOL little_host;
BOOL from_little;
BOOL to_little;
signed short iscale;
float fscale;
BOOL swap_channels;
monostereo_t monostereo;
BOOL silencecuts;
unsigned short silence_thresh;
unsigned short silence_delay;
BOOL silence_val;
cdseccount_t fadein;
cdseccount_t fadeout;
} process_t;
void version (void);
void usage (void);
void help (void);
void exit_error (exit_t err, const char *errtext, const char *errtext2);
BOOL is_localhost_little (void);
int timeprintf (string *buf, unsigned long bytes);
int main (int argc, char *argv[]);
void scan_cmd_args (int argc, char **argv);
void set_message_output (void);
void check_cmd_args (void);
void showcmdargs (void);
signed long get_input_size_in_cd_blocks (void);
unsigned long get_cut_value (int n);
unsigned long get_silence_value (const string *s);
void get_cmdarg_info (cmdarg_t *pcmdarg);
void init_process_info (process_t *pinfo);
void open_out (int track);
void close_out (void);
int get_af_header_size (audioformat_t af);
void read_header (void);
void write_header (void);
void write_trailer (void);
void add_silence (unsigned long bytes);
BOOL copy_sector_check_file (void);
BOOL got_silence_number (char **pstr, UINT16 *ps);
BOOL got_cut_number (char **pstr, unsigned long *pi);
void sprint_cutinfo (void *buffer, unsigned long start, unsigned long end,
BOOL is_audio_interval);
void silence_info (void *buffer, BOOL eof);
void handle_sectors (void);
void do_data_io (void);
void open_input_file (const string *name);
void close_input_file (void);
signed long get_file_size (const string *name, FILE *stream);
void open_output_file (const string *name, int track);
void close_output_file (void);
FILE *open_message_file (void);
void close_message_file (void);
void emergency_close (void);
void read_wav_header (wav_header_t *header);
void make_wav_header (wav_header_t *header, unsigned long databytes);
void write_wav_header (const wav_header_t *header);
size_t read_block (void *buf, size_t bytes);
BOOL read_eof (void);
size_t write_block (const void *buf, size_t bytes);
void process_swap_bytes (void * buf, process_t *pinfo);
void process_swap_words (void * buf, process_t *pinfo);
void process_swap_tolocal (void * buf, process_t *pinfo);
void process_swap_totarget (void * buf, process_t *pinfo);
void process_tomono (void * buf, process_t *pinfo);
void process_tostereo (void * buf, process_t *pinfo);
void process_tomonostereo (void * buf, process_t *pinfo);
void process_swap_iscale (void * buf, process_t *pinfo);
void process_swap_fscale (void * buf, process_t *pinfo);
void process_swap_noscale (void * buf, process_t *pinfo);
void process_fading (void * buf, process_t *pinfo);
void process_silencecuts (void * buf, process_t *pinfo);
void process_sector (void *buf, process_t *pinfo);
# 106 "wav2cdr.c" 2
FILE
*msgfile = ((void *)0);
# 124 "wav2cdr.c"
static void version_text (void);
static void version_text (void)
{
fprintf (msgfile,
# 1 "version.-c" 1
"wav2cdr [OPTIONS] [INPUTFILE [OUTPUTFILE]]\n"
"wav2cdr [OPTIONS] --cut -- CUTNUMBER CUTNUMBER [CUTNUMBER...]\n"
"%-65s(%s)\n"
"\n"
"Convert a wav file to one or more cdr files which can be written on CD.\n"
"Reads stdin, writes stdout. See --help for more information.\n"
"\n"
# 136 "wav2cdr.c" 2
, "Version 2.3.3 Copyright (C) 27 Oct 2000 by Volker Kuhlmann"
, "GNU getopt()"
);
}
void version (void)
{
version_text ();
exit_error (ERR_USAGE, ((void *)0), ((void *)0));
}
void usage (void)
{
version_text ();
fprintf (msgfile,
# 1 "usage.-c" 1
" -h, -u, --usage Display this usage\n"
" --help Display extensive help\n"
" -V, --version Display version\n"
" -i, --inlittle Input data is little endian (LSB, MSB)\n"
" -I, --inbig Input data is big endian (MSB, LSB)\n"
" -o, --outlittle Output data in little endian (LSB, MSB)\n"
" -O, --outbig Output data in big endian (MSB, LSB)\n"
" --monostereo Convert both channels to mono, then back to stereo\n"
" --inwav Input is in wav format (default)\n"
" --incdr Input is in cdr format\n"
" --inraw Input is in raw format\n"
" --tocdr Convert to cdr format (default)\n"
" --towav Convert to wav format\n"
" --toraw Convert to raw format\n"
" --iscale NUM Scale data to NUM percent (100 does nothing)\n"
" --fscale FLOAT Scale data by FLOAT / multiply by FLOAT (1.0 does nothing)\n"
" --startsilence, --ss VAL Add VAL silence to the start of each output file\n"
" --endsilence, --es VAL Add VAL silence to the end of each output file\n"
" --swapchannels, Swap channels (consecutive 16 bit values with each other)\n"
" --noswapchannels, Don't swap channels / words\n"
" --fadein LEN Fade in at the start for a duration of LEN\n"
" --fadeout LEN Fade out at the end\n"
" -r, --infile NAME Input filename (default stdin) ['-' = stdin/stdout]\n"
" -w, --outfile NAME Output name (track number appended to name) (dflt stdout)\n"
" --cut VAL ... All remaining arguments are cut numbers\n"
" --silencecuts Generate cut numbers to cut out intervals of silence\n"
" --silencethresh Threshold for silence detection (default 10)\n"
" --silencedelay Delay for silence detection (default 30C)\n"
" --silenceinfo As --silencecuts, shows info about silent/non-silent parts\n"
" --verbose More output\n"
" --quiet Suppress progress output\n"
" -- Stop option scanning, remaining are filenames or cut numbers\n"
"\n"
" Options are processed left-to-right. Parameters to options must be separated\n"
" by a space from the option. VAL units: b (bytes), C (CD sectors), s (seconds)\n"
"\n"
# 162 "wav2cdr.c" 2
);
showcmdargs ();
exit_error (ERR_USAGE, ((void *)0), ((void *)0));
}
void help (void)
{
fprintf (msgfile,
# 1 "help.-c" 1
"\n"
"wav2cdr(1) wav2cdr(1)\n"
"\n"
"NAME\n"
" wav2cdr - converts input in (or similar to) wav format to cdr for-\n"
" mat suitable for writing onto audio CDs.\n"
"\n"
"SYNOPSIS\n"
" wav2cdr [options ...] [infile [outfile]] [--cut cutnumber ...]\n"
"\n"
"VERSION\n"
" This man page describes wav2cdr version 2.3.3.\n"
"\n"
"DESCRIPTION\n"
" wav2cdr is a conversion program for audio data which adopts auto-\n"
" matically to big and little endian machines. Its primary use was\n"
" to convert wav to cdr, but it is a little more flexible now and\n"
" can handle some file formats and perform some operations on the\n"
" data. These formats are possible (reading and writing):\n"
"\n"
" wav MS Windows sound\n"
" cdr audio CD\n"
" raw fixed sampling rate, channels, and bytes per sample\n"
" (= that of cdr); byte order must be specified\n"
"\n"
" These operations can be performed on the data (combinations are\n"
" possible as long as they are meaningful):\n"
"\n"
" Scaling (volume change), integer arithmetic\n"
" Scaling (volume change), floating point arithmetic\n"
" Cutting of the input into pieces / tracks\n"
" Conversion to mono and back to stereo\n"
" Swapping of the 2 channels\n"
" Adding silence to (or removing from, see cutting) the\n"
" start and/or end\n"
" Generation of cut numbers along silent intervals, e.g.\n"
" to break up a record into tracks\n"
" Information about non-silent intervals\n"
" Fading in and out\n"
"\n"
"OPTIONS\n"
" --cut NUM NUM [NUM...]\n"
" Cut the input into pieces, cutting at positions NUM. See\n"
" sections about argument scanning and splitting below.\n"
"\n"
" --endsilence, --es DUR\n"
" Adds the given amount of silence to the end of each output\n"
" file.\n"
"\n"
" --fadein LEN\n"
" Fade in at the start over a duration of LEN. The syntax\n"
" for LEN is the same as for a cut number, see section about\n"
" argument scanning below. If cutting is active, fade-in is\n"
" applied to the beginning of each cut.\n"
"\n"
" Fading in is performed by increasing the amplitude for CD\n"
" sectors by an amount derived from LEN over a duration of\n"
" LEN. --fadein 3 would result in the amplitude of the first\n"
" sector lowered to 1/4, of the second sector to 2/4, and the\n"
" third sector to 3/4. The fourth sector is unchanged and has\n"
" then reached full amplitude.\n"
"\n"
" --fadeout LEN\n"
" Fade out at the end over a duration of LEN. The syntax for\n"
" LEN is the same as for a cut number, see section about\n"
" argument scanning below. If cutting is active, fad-out is\n"
" applied to the end of each cut.\n"
"\n"
" The computation is similar to --fadein. --fadein 3 would\n"
" result in the last 3 CD sectors having their amplitudes\n"
" lowered to 3/4, 2/4, and 1/4. The (non-existant) following\n"
" sector is assumed to be silent.\n"
"\n"
" To add silent sector(s) to the end of the audio file, use\n"
" --endsilence.\n"
"\n"
" Fading out can only be performed if the input size can be\n"
" determined (i.e. the input must be seekable and cannot be a\n"
" pipe). If cutting is active, the end of the cut is always\n"
" known and the fade-out can be applied.\n"
"\n"
" If the fade-out starts before the fade-in is finished, both\n"
" will overlap, producing sensible results.\n"
"\n"
" --fscale FLOAT\n"
" Scale data by FLOAT, i.e. multiply by FLOAT (1.0 does noth-\n"
" ing).\n"
"\n"
" -h, -u, --usage\n"
" Display usage.\n"
"\n"
" --help Display extensive help. (The information is derived from\n"
" and equivalent to this manual page.)\n"
"\n"
" --inbig, -I\n"
" Input data is big endian (MSB, LSB) (Motorola).\n"
"\n"
" --incdr\n"
" Read cdr format (default is wav). Sets the correct byte\n"
" order.\n"
"\n"
" --infile, -r NAME\n"
" Input filename. Defaults to stdin. '-' = stdin.\n"
"\n"
" --inlittle, -i\n"
" Input data is little endian (LSB, MSB) (Intel).\n"
"\n"
" --inraw\n"
" Read raw format. Byte order should be specified with -i/-I\n"
" (default big).\n"
"\n"
" --inwav\n"
" Read wav format (default). Sets the correct byte order.\n"
"\n"
" --iscale NUM\n"
" Scale data to NUM percent (100 does nothing).\n"
"\n"
" --monostereo\n"
" Convert input to mono and immediately back to stereo. The\n"
" result is 2 channels with the same data. This can be useful\n"
" in some cases.\n"
"\n"
" --noswapchannels\n"
" Don't swap channels. (default)\n"
"\n"
" --outfile, -w NAME\n"
" Write output to file NAME. The track number is appended as\n"
" a 2-digit number. The default is to write output to std-\n"
" out. A NAME of '-' means stdout. When cutting is active\n"
" and more than one cut is made, output can not be written to\n"
" stdout and the use of this option is mandatory.\n"
"\n"
" --outbig, -O\n"
" Output data in big endian (MSB, LSB) (Motorola) byte order.\n"
"\n"
" --outlittle, -o\n"
" Output data in little endian (LSB, MSB) (Intel) byte order.\n"
"\n"
" --quiet\n"
" Suppress progress output. The name of this option might be\n"
" misleading: it does not prevent copious output in other\n"
" places which might be turned on by --verbose.\n"
"\n"
" --silencecuts\n"
" Generate cut numbers for cutting out silent intervals. This\n"
" is useful when digitising a whole record and then cutting\n"
" it into tracks. The cut numbers are output on stdout and\n"
" can be fed back into --cut. After cutting, every second\n"
" track (those with even numbers) contains a silent interval\n"
" and can be deleted.\n"
"\n"
" Together with --verbose, the silence value of each sector\n"
" is printed as well (can't be fed back into --cut then).\n"
" This most likely produces some VERY long lines.\n"
"\n"
" Silence is detected by applying a threshold\n"
" (--silencethresh) to a value computed for each CD sector;\n"
" the value must be below the threshold for a minimum number\n"
" of sectors (delay --silencedelay). Currently, the average\n"
" is computed first (this is the DC component); then the\n"
" average of the absolute of the difference between each sam-\n"
" ple and the DC component. The difference between these 2\n"
" averages is compared with the threshold. Check whether the\n"
" cuts really fall into the silent intervals, and adjust\n"
" threshold and duration if not (or edit the cut numbers man-\n"
" ually).\n"
"\n"
" The silence delay period is part of the signal interval,\n"
" not the silence interval. This means that each non-silent\n"
" period has --silencedelay silence at the start and at the\n"
" end. If the silent interval between two signal intervals is\n"
" less than (2 * silence delay), the silent part at the start\n"
" of the second signal period will be shortened.\n"
"\n"
" --silencedelay DELAY\n"
" The duration for which the \x22""input\x22"" must be below the\n"
" threshold in order to be detected as a silent interval. In\n"
" other words, the number of sectors which must be silent\n"
" before a silent interval is detected. Ignored without\n"
" --silencecuts. The delay can be specified with units in the\n"
" same way as for --cut, and is truncated to full CD sectors.\n"
" Default is 30C (=0.4s).\n"
"\n"
" --silenceinfo\n"
" Similar to --silencecuts, but it generates more informa-\n"
" tion. Silent and non-silent intervals are listed in a tabu-\n"
" lar format. The output format is useful for documentation,\n"
" but not for feeding back into --cut. With --verbose, the\n"
" silence values of each CD sector are shown as well. This\n"
" produces lots of output, but it is useful for finding a\n"
" suitable --silencethresh.\n"
"\n"
" --silencethresh THRESHOLD\n"
" Threshold for silence detection. Ignored without --silence-\n"
" cuts. Default is 10. Always select a threshold as low as\n"
" possible. When cutting a record into tracks, the threshold\n"
" must be high enough to recognise the crackling between\n"
" pieces as silence. When the threshold is too high, a little\n"
" at the beginning and end of each piece might be chopped\n"
" off.\n"
"\n"
" As a special case, if the threshold is set to 0 the usual\n"
" numerical computation of the silence value is bypassed, and\n"
" the sector is deemed to be silent if all samples are 0.\n"
"\n"
" --startsilence, --ss DUR\n"
" Adds the given amount of silence to the start of each out-\n"
" put file.\n"
"\n"
" --swapchannels\n"
" Swap the left with the right channel.\n"
"\n"
" --tocdr\n"
" Write data in cdr format (default). Sets the correct byte\n"
" order.\n"
"\n"
" --toraw\n"
" Write data in raw format. Byte order should be specified\n"
" with -o/-O (default big).\n"
"\n"
" --towav\n"
" Write data in wav format. Sets the correct byte order.\n"
"\n"
" --verbose\n"
" Produce more output. Currently only used by --silencecuts\n"
" and --silenceinfo.\n"
"\n"
" --version, -V\n"
" Display version information.\n"
"\n"
" -- Stop argument processing. Remaining arguments can only be\n"
" filenames, or cut numbers if cutting is used.\n"
"\n"
"Command line option scanning:\n"
" From left to right. Later settings may override previous ones.\n"
" Beware to switch file formats before byte ordering, or a byte\n"
" order might be rejected for the (then active) format. When not\n"
" using cutting, remaining arguments are used to fill up input and\n"
" output filenames. When using cutting, remaining arguments are\n"
" assumed to be cut numbers. When using negative cut numbers, use --\n"
" to terminate option processing or the negative numbers can be mis-\n"
" taken as options (this is a must with GNU getopt()).\n"
"\n"
" All options which take an argument denoting a time accept the fol-\n"
" lowing number format. The number may be in decimal, octal (leading\n"
" 0), or hexadecimal (leading 0x or 0X). A one-letter unit may be\n"
" following. If there is space between the number and the unit, both\n"
" must be quoted, as in \x22""55 C\x22"". These units are recognised: b\n"
" (bytes), C (audio CD sectors), s (seconds). When no unit is given,\n"
" C is assumed. The progress display might only show numbers in some\n"
" of these units. Fractions for seconds are allowed.\n"
"\n"
" Negative cut numbers are only allowed if the input size can be\n"
" determined (which will not be possible if the input comes from a\n"
" pipe), and are shown as the equivalent positive ones. If the last\n"
" cut number is 0 it means the end of the file. If the input file\n"
" size can not be determined the longest possible input (about 405\n"
" minutes) is substituted.\n"
"\n"
" A filename of '-' is taken as stdin/stdout.\n"
"\n"
" If wav2cdr was compiled to use GNU getopt(), argument scanning is\n"
" more powerful and long options can be shortened to significance.\n"
" Options are also re-ordered; this is nice but can be a trap. Use\n"
" -- if in doubt, and don't mix options with filename or cut number\n"
" arguments.\n"
"\n"
"Data formats:\n"
" All data handling currently assumes signed 16-bit integers, inter-\n"
" leaved for 2 channels, at a sampling rate of that of a CD. Only\n"
" wav files with these parameters can be read correctly. cdr files\n"
" are in that format, and only raw formats with these parameters can\n"
" be processed. The only flexibility allowed for raw is the byte\n"
" order, which can be specified for both reading and writing. The\n"
" byte ordering for wav and cdr is fixed.\n"
"\n"
"Channel swapping:\n"
" Left and right channel are swapped, which is the same as swapping\n"
" consecutive 16 bit values with each other. Also see 'CDR Format'\n"
" below.\n"
"\n"
"Scaling / Volume change:\n"
" Scaling can be performed with either integer or floating point\n"
" arithmetic. Integer arithmatic is faster but possibly not as pre-\n"
" cise. Values will saturate (i.e. be clipped), rather than be trun-\n"
" cated. The speed of this operation depends on the endianness of\n"
" the input data, output data, and host. It is slowest when bytes\n"
" have to be swapped before scaling and swapped back after. Nega-\n"
" tive scale factors are allowed but might be of dubious value.\n"
"\n"
"Mono / stereo:\n"
" Input data can be converted to mono and then back to stereo. The\n"
" result is 2 channels with the same data. This can be useful in\n"
" some cases.\n"
"\n"
"Output file naming:\n"
" Unless output is to stdout, the resulting filename is the name\n"
" given with --outfile. A period and a 2-digit track number are\n"
" appended.\n"
"\n"
"Input data splitting:\n"
" Input data can be split into pieces resp. tracks. Currently cuts\n"
" can only be placed at multiples of audio CD sectors (at the sector\n"
" boundaries), whether the input format is cdr or not.\n"
"\n"
" The cuts are placed at the given positions, which must be in\n"
" ascending order (or equal). Negative numbers are counted from the\n"
" end of the input data. This only works if the input is seekable\n"
" (Unix pipes are not). Sectors of the input are numbered from 0.\n"
" Bytes of a header, which the input format might have, are not\n"
" counted.\n"
"\n"
" Any number of cuts can be made, but only 99 tracks can be put on a\n"
" CD. All sectors before the first but not including the first sec-\n"
" tor number are discarded, as well as all sectors after and includ-\n"
" ing the last sector number. At least 2 sector numbers (cut num-\n"
" bers) must be given, in which case one piece is cut out.\n"
"\n"
" If there are only 2 cut numbers (1 track to cut out) data can be\n"
" written to stdout or file. More than one track can only be written\n"
" to file, the track number will be added as an extension to the\n"
" filename. To avoid the track number to be appended to the file-\n"
" name when only one cut is made, don't use --outfile but write to\n"
" stdout and use output redirection.\n"
"\n"
" Example (assuming 50000 sectors in the input):\n"
" wav2cdr < INPUT --outfile NAME --cut 500 20000 40000\n"
" sectors 0- 499: discarded\n"
" 500-19999: saved to NAME.01\n"
" 20000-39999: saved to NAME.02\n"
" 40000-49999: discarded\n"
"\n"
"Cutting out silent intervals:\n"
" Assuming a digitised record is stored in record.wav, and is to be\n"
" cut into tracks.\n"
"\n"
" wav2cdr < record.wav > cuts --silencecuts --silencedelay 2s\n"
" wav2cdr < record.wav --of tracks --cut `cat cuts`\n"
"\n"
" Will store the tracks of the record in track.01, track.02, ...,\n"
" with the delay for cutting at a silent part set to 2 seconds. The\n"
" threshold used is the default. Note the `` syntax works under Unix\n"
" and in this case puts the contents of file \x22""cuts\x22"" on the command\n"
" line.\n"
"\n"
"Information about silences and actual sound parts:\n"
" --silenceinfo can be used in the same way as --silencecuts. It\n"
" produces output like\n"
"\n"
" (stdin):\n"
" silnc 0 b, 0 C, 0 s, 00:00.00 min\n"
" DIFF 811440 b, 345 C, 4 s, 00:04.22 min\n"
" --> 811440 b, 345 C, 4 s, 00:04.22 min\n"
"\n"
" AUDIO 811440 b, 345 C, 4 s, 00:04.22 min\n"
" DIFF 20603520 b, 8760 C, 116 s, 01:56.05 min\n"
" --> 21414960 b, 9105 C, 121 s, 02:01.02 min\n"
"\n"
" showing the beginning, length (\x22""DIFF\x22""), and end (\x22""-->\x22"") of both\n"
" silent (\x22""silnc\x22"") and and non-silent (\x22""AUDIO\x22"") intervals. This is\n"
" useful for examining existing tracks, but it can not be used with\n"
" --cut.\n"
"\n"
"Messages:\n"
" Progress messages and statistics are written to stderr when writ-\n"
" ing to stdout, and to stdout when writing to file. It is currently\n"
" not possible to suppress this, other than by redirection to the\n"
" bit bucket.\n"
"\n"
"Writing wav format:\n"
" Only wav files with 2 channels, 16 bits per sample, and audio CD\n"
" sampling rate can be written. If the input data is different, the\n"
" resulting wav file is incorrect. Scaling can be performed when\n"
" writing wav. Cutting can only be performed in multiples of an\n"
" audio CD sector size. When writing wav the output must be seekable\n"
" (e.g. no pipes).\n"
"\n"
"CDR Format:\n"
" Raw sample data at a sampling rate of %li Hz. The channels are\n"
" interleaved. The numbers are 16 bit signed integers with this\n"
" byte order: MSByte Left, LSByte Left, MSByte Right, LSByte Right.\n"
" The track size must be a multiple of the sector size of %i\n"
" bytes. There are %i sectors per second.\n"
"\n"
"BUGS / LIMITATIONS\n"
" All operations can only be performed on a minimum of 1 CD block or\n"
" a multiple thereof.\n"
"\n"
"COPYRIGHT\n"
" Copyright (C)\n"
" Nov, Dec 1997, Jan, Mar, Apr, May 1998, Feb, May, Jun, Jul,\n"
" Aug 1999, Oct 2000 by\n"
" Volker Kuhlmann <VolkerKuhlmann@gmx.de>\n"
" c/o EEE Dept, University of Canterbury\n"
" Christchurch, New Zealand\n"
"\n"
" Permission granted to use and distribute this software free of\n"
" charge, provided any improvements are sent back to the author.\n"
" Comments and bug reports welcome. All rights reserved. Standard\n"
" disclaimer applies.\n"
"\n"
"AUTHOR\n"
" Volker Kuhlmann\n"
"\n"
"wav2cdr 27 Oct 2000 1\n"
"\n"
# 179 "wav2cdr.c" 2
, 44100L
, 2352
, 75
);
exit_error (ERR_USAGE, ((void *)0), ((void *)0));
}
# 198 "wav2cdr.c"
void exit_error (exit_t err, const char *errtext, const char *errtext2)
{
if (errtext != ((void *)0)) {
fprintf (stderr, "wav2cdr: error: %s%s",
errtext, errtext2 == ((void *)0) ? "" : errtext2);
}
if (err == ERR_IO) {
if ((*__errno_location ()) != 0)
fprintf (stderr, " (%s)", strerror ((*__errno_location ())));
}
if (errtext != ((void *)0) || err == ERR_IO)
_IO_putc ('\n', stderr);
if (err == ERR_CMDARG)
fprintf (stderr,
"Use -h or -u or --usage for usage, or --help for more help\n");
emergency_close ();
exit ((int) err);
}
# 227 "wav2cdr.c"
BOOL is_localhost_little (void)
{
UINT16 lclfmt = 1;
UINT8 *is_little = (UINT8 *) &lclfmt;
((void) ((sizeof(UINT16) == 2 * sizeof(UINT8)) ? 0 : (__assert_fail ("sizeof(UINT16) == 2 * sizeof(UINT8)", "wav2cdr.c", 233, __PRETTY_FUNCTION__), 0)));
# 245 "wav2cdr.c"
return (*is_little != 0);
}
# 257 "wav2cdr.c"
int timeprintf (string *buf, unsigned long bytes)
{
unsigned short
m,
s,
fs;
s = (bytes / 2352) / 75;
fs = (bytes - (unsigned long) s * (75 * 2352))
* 100 / ((unsigned long) (75 * 2352));
m = s / 60;
s = s % 60;
return sprintf (buf, "%02d:%02d.%02d", m, s, fs);
}
int main (int argc, char *argv[])
{
((void) ((sizeof(UINT8) == 1) ? 0 : (__assert_fail ("sizeof(UINT8) == 1", "wav2cdr.c", 278, __PRETTY_FUNCTION__), 0)));
((void) ((sizeof(UINT16) == 2) ? 0 : (__assert_fail ("sizeof(UINT16) == 2", "wav2cdr.c", 279, __PRETTY_FUNCTION__), 0)));
((void) ((sizeof(UINT32) == 4) ? 0 : (__assert_fail ("sizeof(UINT32) == 4", "wav2cdr.c", 280, __PRETTY_FUNCTION__), 0)));
((void) ((sizeof(SINT16) == 2) ? 0 : (__assert_fail ("sizeof(SINT16) == 2", "wav2cdr.c", 281, __PRETTY_FUNCTION__), 0)));
((void) ((sizeof(SINT32) == 4) ? 0 : (__assert_fail ("sizeof(SINT32) == 4", "wav2cdr.c", 282, __PRETTY_FUNCTION__), 0)));
((void) ((sizeof(audiosect_t) >= sizeof(wav_header_t)) ? 0 : (__assert_fail ("sizeof(audiosect_t) >= sizeof(wav_header_t)", "wav2cdr.c", 284, __PRETTY_FUNCTION__), 0)));
((void) ((sizeof(audiosect_t) % 4 == 0) ? 0 : (__assert_fail ("sizeof(audiosect_t) % 4 == 0", "wav2cdr.c", 285, __PRETTY_FUNCTION__), 0)));
((void) ((32767 == 65535/2) ? 0 : (__assert_fail ("32767 == 65535/2", "wav2cdr.c", 291, __PRETTY_FUNCTION__), 0)));
((void) (((long)32767 == 32767L) ? 0 : (__assert_fail ("(long)32767 == 32767L", "wav2cdr.c", 293, __PRETTY_FUNCTION__), 0)));
scan_cmd_args (argc, argv);
set_message_output ();
check_cmd_args ();
showcmdargs ();
do_data_io ();
return ERR_OK;
}
Reply to: