aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/interpolate.h1
-rw-r--r--src/include/wavedata.h1
-rw-r--r--src/include/wdatutil.h8
-rw-r--r--src/wavedata.c14
-rw-r--r--src/wavegen.c19
-rw-r--r--src/wdatutil.c7
6 files changed, 21 insertions, 29 deletions
diff --git a/src/include/interpolate.h b/src/include/interpolate.h
index 304a817..237008c 100644
--- a/src/include/interpolate.h
+++ b/src/include/interpolate.h
@@ -1,7 +1,6 @@
#ifndef blop_interpolate_h
#define blop_interpolate_h
-#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
#include "blop_config.h"
#include "math_func.h"
diff --git a/src/include/wavedata.h b/src/include/wavedata.h
index 9d24823..97b2986 100644
--- a/src/include/wavedata.h
+++ b/src/include/wavedata.h
@@ -20,7 +20,6 @@
#ifndef blop_wavedata_h
#define blop_wavedata_h
-#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
#include "blop_config.h"
#include "math_func.h"
#include "interpolate.h"
diff --git a/src/include/wdatutil.h b/src/include/wdatutil.h
index a084c7a..b87b637 100644
--- a/src/include/wdatutil.h
+++ b/src/include/wdatutil.h
@@ -21,7 +21,7 @@
#define blop_wdatutil_h
#include <stdio.h>
-#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
+#include <stdint.h>
#include "math_func.h"
#include "wavedata.h"
@@ -130,9 +130,9 @@ void wavedata_generate_tables(Wavedata* w,
* Returns: 0 on success
* -1 otherwise
******************************************************************************/
-int wavedata_write(Wavedata* w,
- FILE* wdat_fp,
- char* prefix);
+int wavedata_write(Wavedata* w,
+ FILE* wdat_fp,
+ const char* prefix);
#ifdef __cplusplus
} /* extern "C" { */
diff --git a/src/wavedata.c b/src/wavedata.c
index 24d4c36..e574903 100644
--- a/src/wavedata.c
+++ b/src/wavedata.c
@@ -17,10 +17,6 @@
along with this software. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#include <dlfcn.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -28,6 +24,16 @@
#include "blop_config.h"
#include "wavedata.h"
+#ifdef _WIN32
+# include <windows.h>
+# define dlopen(path, flags) LoadLibrary(path)
+# define dlclose(lib) FreeLibrary((HMODULE)lib)
+# define dlsym(lib, sym) GetProcAddress((HMODULE)lib, sym)
+# define snprintf _snprintf
+#else
+# include <dlfcn.h>
+#endif
+
int
wavedata_load(Wavedata* w,
const char* bundle_path,
diff --git a/src/wavegen.c b/src/wavegen.c
index 53c5db1..c722e04 100644
--- a/src/wavegen.c
+++ b/src/wavegen.c
@@ -17,13 +17,10 @@
along with this software. If not, see <http://www.gnu.org/licenses/>.
*/
-#define _POSIX_C_SOURCE 200809L // strdup
-
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <getopt.h>
-#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
#include "wdatutil.h"
#include "wavedata.h"
#include "common.h"
@@ -99,9 +96,9 @@ main(int argc,
long first_note = -1;
long note_step = -1;
long min_table_size = -1;
- char* filename = NULL;
+ const char* filename = NULL;
FILE* file;
- char* prefix = NULL;
+ const char* prefix = NULL;
float gibbs = 0.0f;
int quiet = 0;
int test = 0;
@@ -154,10 +151,10 @@ main(int argc,
min_table_size = (long)atoi(optarg);
break;
case 'o':
- filename = strdup(optarg);
+ filename = optarg;
break;
case 'p':
- prefix = strdup(optarg);
+ prefix = optarg;
break;
case 'g':
gibbs = atof(optarg);
@@ -307,14 +304,6 @@ main(int argc,
}
}
- if (filename) {
- free(filename);
- }
-
- if (prefix) {
- free(prefix);
- }
-
wavedata_cleanup(w);
return 0;
diff --git a/src/wdatutil.c b/src/wdatutil.c
index 636981b..122feec 100644
--- a/src/wdatutil.c
+++ b/src/wdatutil.c
@@ -20,7 +20,6 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
#include "common.h"
#include "math_func.h"
#include "wavedata.h"
@@ -243,9 +242,9 @@ wavedata_generate_tables(Wavedata* w,
}
int
-wavedata_write(Wavedata* w,
- FILE* wdat_fp,
- char* data_name)
+wavedata_write(Wavedata* w,
+ FILE* wdat_fp,
+ const char* data_name)
{
Wavetable* t = 0;
unsigned long table_count;