1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-10 00:23:32 +02:00

Update Nyquist to v3.09.

This commit is contained in:
Leland Lucius
2015-04-07 22:10:17 -05:00
parent f88b27e6d8
commit 9fb0ce5b82
358 changed files with 26327 additions and 7043 deletions

View File

@@ -537,8 +537,14 @@ FILE *fileopen(deflt, extension, mode, prompt)
strcpy(extname, fileopen_name);
strcat(extname, ".");
strcat(extname, extension);
fp = fopen(fileopen_name, mode);
fpext = fopen(extname, mode);
fp = NULL;
fpext = NULL;
if (ok_to_open(fileopen_name, mode)) {
fp = fopen(fileopen_name, mode);
}
if (ok_to_open(extname, mode)) {
fpext = fopen(extname, mode);
}
if (fp != NULL && fpext != NULL) {
gprintf(TRANS,
"warning: both %s and %s exist. %s will be used.\n",
@@ -566,7 +572,9 @@ FILE *fileopen(deflt, extension, mode, prompt)
&& added_extension
#endif
) {
fp = fopen(fileopen_name, "r");
fp = NULL;
if (ok_to_open(fileopen_name, "r"))
fp = fopen(fileopen_name, "r");
if (fp != NULL) {
char question[100];
fclose(fp);
@@ -579,7 +587,9 @@ FILE *fileopen(deflt, extension, mode, prompt)
}
}
}
fp = fopen(fileopen_name, mode);
fp = NULL;
if (ok_to_open(fileopen_name, mode))
fp = fopen(fileopen_name, mode);
if (fp == NULL) problem = "Couldn't create %s.\n";
}
tryagain:
@@ -592,7 +602,6 @@ FILE *fileopen(deflt, extension, mode, prompt)
return fp;
}
#ifdef MACINTOSH
static int GetReadFileName(name)
@@ -786,7 +795,7 @@ void readln(fp)
* Note that to handle the variable argument list, a number of different
* approaches are implemented. The first part of the implementation selects
* one of 4 ways to build temp1, a formatted string. The 4 ways arise from
* use or non-use of vsprintf, and use or non-use of ... in the arg list.
* use or non-use of vsnprintf, and use or non-use of ... in the arg list.
* After building temp1, non-Amiga systems write to stdout or stderr,
* whereas AMIGA writes to a special console. Why? Because the Amiga
* needs a new console so we can set up a signal upon character typein.
@@ -794,10 +803,10 @@ void readln(fp)
#ifndef gprintf
#define GPRINTF_MESSAGE_LEN 512
#ifdef USE_VSPRINTF
#ifdef HAVE_VSNPRINTF
#ifdef DOTS_FOR_ARGS
/* define with ... in arg list and use vsprintf to get temp1 */
/* define with ... in arg list and use vsnprintf to get temp1 */
public void gprintf(long where, char *format, ...)
{
char temp1[GPRINTF_MESSAGE_LEN];
@@ -807,12 +816,12 @@ public void gprintf(long where, char *format, ...)
va_list ap;
va_start(ap, format);
vsprintf(temp1, format, ap);
vsnprintf(temp1, GPRINTF_MESSAGE_LEN, format, ap);
va_end(ap);
#else /* !DOTS_FOR_ARGS */
/* define with va_alist and use vsprintf to get temp1 */
/* define with va_alist and use vsnprintf to get temp1 */
public void gprintf(where, format, va_alist)
long where;
char *format;
@@ -823,19 +832,19 @@ va_dcl
/* this is a syntax error - if you don't have to remove this, */
/* then this whole section of code is unnecessary. */
va_start(pvar);
vsprintf(temp1, format, pvar);
vsnprintf(temp1, GPRINTF_MESSAGE_LEN, format, pvar);
va_end(pvar);
#endif /* DOTS_FOR_ARGS */
#else /* !USE_VSPRINTF */
#else /* !HAVE_VSNPRINTF */
#define MAX_GPRINTF_ARGS 10
typedef struct gp_args_struct {
long arg[MAX_GPRINTF_ARGS];
} gp_args_node;
#ifdef DOTS_FOR_ARGS
/* use ... but not vsprintf */
/* use ... but not vsnprintf */
public void gprintf(long where, char *format, ...)
{
char temp1[GPRINTF_MESSAGE_LEN];
@@ -848,7 +857,7 @@ public void gprintf(long where, char *format, ...)
args = va_arg(ap, gp_args_node);
va_end(ap);
#else /* !DOTS_FOR_ARGS */
/* don't use ... and don't use vsprintf */
/* don't use ... and don't use vsnprintf */
public void gprintf(where, format, args)
long where;
char *format;
@@ -860,9 +869,9 @@ public void gprintf(where, format, args)
#endif /* AMIGA*/
#endif /* DOTS_FOR_ARGS */
sprintf(temp1, format, args);
snprintf(temp1, GPRINTF_MESSAGE_LEN, format, args);
#endif /* USE_VSPRINTF */
#endif /* HAVE_VSNPRINTF */
/*
* Now we've got formatted output in temp1. Write it out.