+/*
+ Copyright (C) 2012 Paul Davis
+
+ 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
/** @file libs/ardour/vst_info_file.cc
* @brief Code to manage info files containing cached information about a plugin.
* e.g. its name, creator etc.
}
/** Read an integer value from a line in fp into n,
- * @return true on success, false on failure.
+ * @return true on failure, false on success.
*/
static bool
read_int (FILE* fp, int* n)
char* p = fgets (buf, MAX_STRING_LEN, fp);
if (p == 0) {
- return false;
+ return true;
}
return (sscanf (p, "%d", n) != 1);
}
} else {
- dir = Glib::path_get_dirname (dllpath);
+ dir = Glib::path_get_dirname (std::string(dllpath));
}
stringstream s;
{
struct stat own_statbuf;
struct stat sys_statbuf;
+ FILE *rv = NULL;
char* own_info = vstfx_infofile_stat (dllpath, &own_statbuf, 1);
char* sys_info = vstfx_infofile_stat (dllpath, &sys_statbuf, 0);
if (sys_info) {
if (own_statbuf.st_mtime <= sys_statbuf.st_mtime) {
/* system info file is newer, use it */
- return fopen (sys_info, "r");
+ rv = g_fopen (sys_info, "rb");
}
} else {
- return fopen (own_info, "r");
+ rv = g_fopen (own_info, "rb");
}
}
+ free(own_info);
+ free(sys_info);
- return 0;
+ return rv;
}
static FILE *
free (info->name);
free (info->creator);
free (info->Category);
+ free (info->ParamNames);
+ free (info->ParamLabels);
free (info);
}